public void GetBlock(ref SmallBuffer <T> sb, int size, int initSize = 0) { if (sb.IsInit) { return; } this.InnerGetBlock(ref sb, size, initSize); }
private void InnerGetBlock(ref SmallBuffer <T> sb, int size, int initSize) { BufferBlock bb = default(BufferBlock); if (this.InnerGetBlock(ref bb, size, initSize)) { sb.Init(bb, this); sb.DeepClear(); return; } sb.Init(bb, this, new T[bb.capacity]); }
public void ReturnBlock(ref SmallBuffer <T> sb) { BufferBlock bufferBlock = sb.bufferBlock; if (bufferBlock.inUse) { bufferBlock.size = 0; bufferBlock.inUse = false; if (bufferBlock.blockIndex >= 0) { this.blocks[bufferBlock.blockIndex] = bufferBlock; this.allocBlockCount--; } sb.UnInit(); } }
public void ReturnSmallBuffer(ref SmallBuffer <object> sb) { this.m_ObjSmallBufferPool.ReturnBlock(ref sb); }
public void GetSmallBuffer(ref SmallBuffer <object> sb, int size, int initSize = 0) { this.m_ObjSmallBufferPool.GetBlock(ref sb, size, 0); }
public void ReturnSmallBuffer(ref SmallBuffer <ulong> sb) { this.m_ULongSmallBufferPool.ReturnBlock(ref sb); }
public void GetSmallBuffer(ref SmallBuffer <ulong> sb, int size, int initSize = 0) { this.m_ULongSmallBufferPool.GetBlock(ref sb, size, 0); }
public void ReturnSmallBuffer(ref SmallBuffer <uint> sb) { this.m_UIntSmallBufferPool.ReturnBlock(ref sb); }
public void ExpandBlock(ref SmallBuffer <T> sb, int size) { this.InnerGetBlock(ref sb, size, 0); }