protected override void Dispose(bool disposing) { if (pointer != null) { NativeMemoryAllocator.Free(pointer, size); pointer = null; size = 0; } }
public NativeMemoryRawModuleBytes(int size) { if (size < 0) { throw new ArgumentOutOfRangeException(nameof(size)); } pointer = size == 0 ? null : NativeMemoryAllocator.Allocate(size); this.size = size; }