Method AllocateDataSection
AllocateDataSection(nuint, uint, uint, LazyEncodedString, bool)
Allocate a block of contiguous memory for use as data by the native code JIT engine
public abstract nuint AllocateDataSection(nuint size, uint alignment, uint sectionId, LazyEncodedString sectionName, bool isReadOnly)
Parameters
sizenuintSize of the block
alignmentuintalignment requirements of the block
sectionIduintID for the section
sectionNameLazyEncodedStringName of the section
isReadOnlyboolMemory section is Read-Only
Returns
- nuint
Address of the first byte of the allocated memory
Remarks
If the memory is allocated from the managed heap then the returned address MUST remain pinned until Dispose() is called on this allocator.
important
The isReadOnly and any other page properties is not applied to the returned
address (or entire memory of the allocated section) until FinalizeMemory(out LazyEncodedString?) is called.
This allows the JIT to write initial data into the memory even if it is ultimately Read-Only.