Age | Commit message (Collapse) | Author |
|
* FieldRVA alignment
In support of dotnet/runtime#60948 the linker (an assembly rewriter) will need to be able to preserve the alignment of RVA based fields which are to be used to create the data for `CreateSpan<T>` records
This is implemented by adding a concept that RVA fields detect their required alignment by examining the PackingSize of the type of the field (if the field type is defined locally in the module)
* Update Mono.Cecil.Metadata/Buffers.cs
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
* Enhace logic used to ensure type providing PackingSize is local to the module.
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
|
|
|
|
|
|
|
|
right thing
|
|
|
|
|
|
This change reduces the size of StringHeap by re-using string suffixes wherever possible.
Before this change, if metadata strings `foo` and `foobar` were needed, both would be emitted.
With this change, only `foobar` will be emitted and its suffix will be used for `bar`.
Most of the implementation is taken from Roslyn: https://github.com/dotnet/roslyn/blob/614299ff83da9959fa07131c6d0ffbc58873b6ae/src/Compilers/Core/Portable/System/Reflection/Metadata/Ecma335/MetadataBuilder.Heaps.cs#L287
StringHeapBuffer.GetStringIndex doesn't eagerly write bytes to the buffer; instead, it just assigns each string
an index and keeps the map from strings to indexes. After AssemblyWriter.BuildModule completes and all strings have been
collected, a new method WriteStrings implements the optimization that reuses string suffixes. A map of string indexes to buffer
offsets is returned. That map is used in Metadata.WriteString to emit correct string offsets.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- when used as key in a dict, implementing IEquatable will avoid
object boxing when comparing keys.
- big perf increase when loading assemblies.
|
|
Conflicts:
Mono.Cecil.PE/Image.cs
Mono.Cecil/DefaultAssemblyResolver.cs
Mono.Cecil/ModuleDefinition.cs
Test/Mono.Cecil.Tests/Addin.cs
Test/Mono.Cecil.Tests/ImageReadTests.cs
Test/Mono.Cecil.Tests/ImportCecilTests.cs
Test/Mono.Cecil.Tests/ImportReflectionTests.cs
|
|
|
|
|
|
|
|
|
|
stream
|
|
the file, dispose your modules
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|