예제 #1
0
        public SparseLinkedListBase <T> .RealizedNode GetRealizedNode()
        {
            var realizedNode = RealizedNodePool.Count > 0
                                ? RealizedNodePool.Pop()
                                : new SparseLinkedListBase <T> .RealizedNode();

            MountNode(realizedNode);
            realizedNode.Mount(SparseMemoryManager.Allocate());

            return(realizedNode);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public void ReleaseRealizedNode(SparseLinkedListBase <T> .RealizedNode realizedNode)
 {
     RealizedNodePool.Push(realizedNode);
 }