Beispiel #1
0
        public SparseLinkedListBase <T> .GapNode GetGapNode()
        {
            var gapNode = GapNodePool.Count > 0 ? GapNodePool.Pop() : new SparseLinkedListBase <T> .GapNode();

            MountNode(gapNode);

            return(gapNode);
        }
Beispiel #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);
        }