/// <summary>Returns one or more buffers as a linked list.</summary> public static void Return(BlockBuffer bufferStart, BlockBuffer bufferEnd) { if (bufferStart == null) { return; } // Push into pool: bufferEnd.Next = FirstBuffer; FirstBuffer = bufferStart; }
/// <summary>Gets a vert buffer from the pool.</summary> public static BlockBuffer GetBuffer() { BlockBuffer result; if (FirstBuffer == null) { result = new BlockBuffer(); return(result); } result = FirstBuffer; FirstBuffer = result.Next; result.Next = null; return(result); }
/// <summary>Clears out both buffer pools, freeing some memory.</summary> public static void Clear() { // Empty both buffer pools: FirstBuffer = null; }