示例#1
0
	static void ClearPooled(List<xChunk> &lstSrc) noexcept {
		if(lstSrc.IsEmpty()){
			return;
		}
		const auto vLock = s_vPoolMutex.GetLock();
		s_lstPool.Splice(nullptr, lstSrc);
	}
示例#2
0
	static xChunk &UnshiftPooled(List<xChunk> &lstDst){
		typename List<xChunk>::Node *pNode;
		{
			const auto vLock = s_vPoolMutex.GetLock();
			if(!s_lstPool.IsEmpty()){
				pNode = s_lstPool.GetFirst();
				lstDst.Splice(lstDst.GetFirst(), s_lstPool, s_lstPool.GetFirst());
				goto jDone;
			}
		}
		pNode = lstDst.Unshift();

	jDone:
#ifndef NDEBUG
		__builtin_memset(&pNode->Get(), 0xCC, sizeof(xChunk));
#endif
		return pNode->Get();
	}
示例#3
0
	static void ShiftPooled(List<xChunk> &lstSrc) noexcept {
		ASSERT(!lstSrc.IsEmpty());

		const auto vLock = s_vPoolMutex.GetLock();
		s_lstPool.Splice(nullptr, lstSrc, lstSrc.GetFirst());
	}