public override void Dispose(bool disposing)
		{
			if (pin != null) {
				pin.Dispose();
			}
			pin = null;
		}
예제 #2
0
 public override void Dispose(bool disposing)
 {
     if (pin != null)
     {
         pin.Dispose();
     }
     pin = null;
 }
예제 #3
0
 public void Execute(byte[] data, int length)
 {
     using (buffer = new BufferPin(data))
     {
         var handle = GCHandle.Alloc(settings, GCHandleType.Pinned);
         http_parser_execute(ParserPointer, handle.AddrOfPinnedObject(), buffer.Pointer, (IntPtr)length);
         handle.Free();
     }
     buffer = null;
 }
		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();
		}
예제 #5
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());
 }
예제 #6
0
 public void Execute(byte[] data, int length)
 {
     using (buffer = new BufferPin(data))
     {
         var handle = GCHandle.Alloc(settings, GCHandleType.Pinned);
         http_parser_execute(ParserPointer, handle.AddrOfPinnedObject(), buffer.Pointer, (IntPtr)length);
         handle.Free();
     }
     buffer = null;
 }