Table of Contents

Constructor MemoryBuffer

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

MemoryBuffer(string)

Initializes a new instance of the MemoryBuffer class from a file

public MemoryBuffer(string path)

Parameters

path string

Path of the file to load

MemoryBuffer(byte[], LazyEncodedString?)

Initializes a new instance of the MemoryBuffer class from a byte array

public MemoryBuffer(byte[] data, LazyEncodedString? name = null)

Parameters

data byte[]

Array of bytes to copy into the memory buffer

name LazyEncodedString

Name of the buffer (for diagnostics)

Remarks

This constructor makes a copy of the data array as a MemoryBuffer the memory in the buffer is unmanaged memory usable by the LLVM native code. It is released in the Dispose method

MemoryBuffer(byte*, nuint, LazyEncodedString, bool)

Initializes a new instance of the MemoryBuffer class to wrap an existing memory region

public MemoryBuffer(byte* data, nuint len, LazyEncodedString name, bool requiresNullTerminator)

Parameters

data byte*

Data for the region [Must remain valid for the entire lifetime of this instance!]

len nuint

Length of the region

name LazyEncodedString

Name of the buffer

requiresNullTerminator bool

Indicates if the data requires a null terminator