public void Free(ref GpuCacheHandle handle) { FreeListHandle freeListHandle = handle.Value; _slots.ThrowIfInvalid(freeListHandle); Span <Vector4> blocks = GetBlocks(freeListHandle.Index, freeing: true); blocks.Clear(); _slots.Free(ref freeListHandle); handle = GpuCacheHandle.Invalid; }
private void DereferenceBlock(ushort blockId) { ViewDescriptor vd; vd = _views[blockId]; vd.RefCount--; if (vd.RefCount == 0) { _views.Remove(vd.BlockId); _views2.Remove(vd.View.Memory); vd.View.Dispose(); _vdFreeList.Free(vd); } }