Constructor MemoryBuffer
MemoryBuffer(string)
Initializes a new instance of the MemoryBuffer class from a file
[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "msg is Disposed IFF it is valid to begin with")]
public MemoryBuffer(string path)
Parameters
pathstringPath 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
databyte[]Array of bytes to copy into the memory buffer
nameLazyEncodedStringName 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)