public override void Dispose(bool disposing)
		{
			if (pin != null) {
				pin.Dispose();
			}
			pin = null;
		}
Exemplo n.º 2
0
 public override void Dispose(bool disposing)
 {
     if (pin != null)
     {
         pin.Dispose();
     }
     pin = null;
 }
Exemplo n.º 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();
		}
Exemplo n.º 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());
 }
Exemplo n.º 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;
 }