Constructor MemoryBuffer
MemoryBuffer(string)
Initializes a new instance of the MemoryBuffer class from a file
public MemoryBuffer(string path)
Parameters
path
stringPath 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
LazyEncodedStringName 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
nuintLength of the region
name
LazyEncodedStringName of the buffer
requiresNullTerminator
boolIndicates if the data requires a null terminator