public void Free() { if (_handle.IsAllocated) { _handle.Free(); } if (_owner != null) { _owner.Release(); _owner = null; } }
/// <summary> /// Frees the pinned handle and releases IRetainable. /// </summary> public void Dispose() { if (_handle.IsAllocated) { _handle.Free(); } if (_retainable != null) { _retainable.Release(); _retainable = null; } _pointer = null; }
public MemoryHandle(IRetainable owner, void *pointer = null, System.Runtime.InteropServices.GCHandle handle = default(System.Runtime.InteropServices.GCHandle)) { throw null; }
public BufferHandle(IRetainable owner, void *pinnedPointer, GCHandle handle = default(GCHandle)) { _pointer = pinnedPointer; _handle = handle; _owner = owner; }
/// <summary> /// Creates a new memory handle for the memory. /// </summary> /// <param name="retainable">reference to manually managed object</param> /// <param name="pinnedPointer">pointer to the buffer, or null if the buffer is not pinned</param> /// <param name="handle">handle used to pin array buffers</param> public MemoryHandle(IRetainable retainable, void *pinnedPointer = null, GCHandle handle = default(GCHandle)) { _retainable = retainable; _pointer = pinnedPointer; _handle = handle; }
public void Dispose() { _owner.Release(); _owner = null; }
internal DisposableReservation(IRetainable owner) { _owner = owner; _owner.Retain(); }
public BufferHandle(IRetainable owner) : this(owner, null) { }
public MemoryHandle(IRetainable owner, void *pointer = null, GCHandle handle = default(GCHandle)) { _owner = owner; _pointer = pointer; _handle = handle; }