public SparseLinkedListBase <T> .RealizedNode GetRealizedNode() { var realizedNode = RealizedNodePool.Count > 0 ? RealizedNodePool.Pop() : new SparseLinkedListBase <T> .RealizedNode(); MountNode(realizedNode); realizedNode.Mount(SparseMemoryManager.Allocate()); return(realizedNode); }
public void ReleaseNode(SparseLinkedListBase <T> .NodeBase node) { OnNodeReleasing(node); node.Release(); if (node is SparseLinkedListBase <T> .GapNode gapNode) { GapNodePool.Push(gapNode); } else if (node is SparseLinkedListBase <T> .RealizedNode realizedNode) { RealizedNodePool.Push(realizedNode); } OnNodeReleased(node); }
public void ReleaseRealizedNode(SparseLinkedListBase <T> .RealizedNode realizedNode) { RealizedNodePool.Push(realizedNode); }