/// <summary> /// Note: We only support process heap for now, as using any other heap /// would require us to keep a SafeHandle to the heap, and this creates /// problems during finalization during .NET CLR shutdown -- referencing and /// using a managed object during finalization leads to undeterministic /// behavior. /// </summary> public SafeHeapBlockHandle(SafeProcessHeapHandle heap, IntPtr handle, long byteLength) : base(true) { _processHeapPtr = heap.DangerousGetHandle(); _byteLength = byteLength; SetHandle(handle); }
/// <summary> /// Note: We only support process heap for now, as using any other heap /// would require us to keep a SafeHandle to the heap, and this creates /// problems during finalization during .NET CLR shutdown -- referencing and /// using a managed object during finalization leads to undeterministic /// behavior. /// </summary> public SafeHeapBlockHandle(SafeProcessHeapHandle heap, IntPtr handle, long byteLength) : base(true) { _processHeapPtr = heap.DangerousGetHandle(); _byteLength = byteLength; SetHandle(handle); }