public static void DropPool() { while (_root != null) { var node = _root; _root = node.Next; node.Value = null; node.Next = null; PoolNode.Recycle(node); } }
/// <summary> /// Gets the pool's current capacity /// </summary> public static uint Count() { uint count = 0; PoolNode it = _root; while (it != null) { count++; it = it.Next; } return(count); }
public static PoolNode GetNewNode() { if (_root == null) { return(new PoolNode()); } var n = _root; _root = _root.Next; n.Next = null; n.Value = null; return(n); }
public static void Recycle(PoolNode node) { node.Value = null; node.Next = _root; _root = node; }