Ejemplo n.º 1
0
 public VirtualMemoryPtr(int memorySize)
     : base(IntPtr.Zero, ownsHandle: true)
 {
     ProcessHandle    = VirtualMemoryManager.GetCurrentProcessHandle();
     MemorySize       = (IntPtr)memorySize;
     AllocatedPointer = VirtualMemoryManager.AllocExecutionBlock(memorySize, ProcessHandle);
     Disposed         = false;
 }
Ejemplo n.º 2
0
 protected override bool ReleaseHandle()
 {
     if (!Disposed)
     {
         Disposed = true;
         GC.SuppressFinalize(this);
         VirtualMemoryManager.VirtualFreeEx(ProcessHandle, AllocatedPointer, MemorySize);
     }
     return(true);
 }