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