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