Table of Contents

Class GlobalMemoryAllocatorBase

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

Base class for a Global allocator for use as an Object layer in OrcJITv2

[Experimental("LLVMEXP004")]
public abstract class GlobalMemoryAllocatorBase : ObjectLayer, IDisposable, IJitMemoryAllocator
Inheritance
GlobalMemoryAllocatorBase
Implements
Inherited Members

Remarks

Instances of this are provided as an object layer via an implementation of ObjectLayerFactory. While this type implements IDisposable via ObjectLayer it is ONLY intended for clean up on exceptions. A factory returns the instances to the native JIT, which takes over ownership.

Derived types need not be concerned with any of the low level native interop. Instead they simply implement the abstract methods to perform the required allocations. This base type handles all of the interop, including the reverse P/Invoke marshaling for callbacks.

Constructors

GlobalMemoryAllocatorBase(ExecutionSession)

Initializes a new instance of the GlobalMemoryAllocatorBase class.

Methods

AllocateCodeSection(nuint, uint, uint, LazyEncodedString)

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

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

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

FinalizeMemory(out LazyEncodedString?)

Finalizes a previous allocation by applying page settings for the allocation

ReleaseContext()

Release the context for the memory. No further callbacks will occur for this allocator