Table of Contents

Method AllocateDataSection

Namespace
Ubiquity.NET.Llvm.OrcJITv2
Assembly
Ubiquity.NET.Llvm.dll

AllocateDataSection(nuint, uint, uint, LazyEncodedString, bool)

Allocate a block of contiguous memory for use as data by the native code JIT engine

nuint AllocateDataSection(nuint size, uint alignment, uint sectionId, LazyEncodedString sectionName, bool isReadOnly)

Parameters

size nuint

Size of the block

alignment uint

alignment requirements of the block

sectionId uint

ID for the section

sectionName LazyEncodedString

Name of the section

isReadOnly bool

Memory 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.