static void ClearPooled(List<xChunk> &lstSrc) noexcept { if(lstSrc.IsEmpty()){ return; } const auto vLock = s_vPoolMutex.GetLock(); s_lstPool.Splice(nullptr, lstSrc); }
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(); }
static void ShiftPooled(List<xChunk> &lstSrc) noexcept { ASSERT(!lstSrc.IsEmpty()); const auto vLock = s_vPoolMutex.GetLock(); s_lstPool.Splice(nullptr, lstSrc, lstSrc.GetFirst()); }