public static void DrainQueue <T>(Queue <T> queue) where T : IVoltPoolable <T> { while (queue.Count > 0) { VoltPool.Free(queue.Dequeue()); } }
private void ClearContacts() { for (int i = 0; i < this.used; i++) { VoltPool.Free(this.contacts[i]); } this.used = 0; }
public static void SafeReplace <T>(ref T destination, T obj) where T : IVoltPoolable <T> { if (destination != null) { VoltPool.Free(destination); } destination = obj; }