Example #1
0
 public override void Dispose(bool disposing)
 {
     if (pin != null)
     {
         pin.Dispose();
     }
     pin = null;
 }
Example #2
0
 public override int Alloc(int size, out IntPtr ptr)
 {
     if (pin == null)
     {
         pin = new BufferPin(size);
     }
     else if (pin.Buffer.Length < size)
     {
         pin.Dispose();
         pin = new BufferPin(size);
     }
     ptr = pin.Start;
     return(pin.Count.ToInt32());
 }