take several blocks from global free list (max FL_GROUP_SIZE blocks), returns number of blocks taken buf should have space for at least FL_GROUP_SIZE elems
| 960 | // take several blocks from global free list (max FL_GROUP_SIZE blocks), returns number of blocks taken |
| 961 | // buf should have space for at least FL_GROUP_SIZE elems |
| 962 | static Y_FORCE_INLINE int TakeBlocksFromGlobalFreeList(int nSizeIdx, char** buf) { |
| 963 | TLFAllocFreeList& fl = globalFreeLists[nSizeIdx]; |
| 964 | TFreeListGroup* g = (TFreeListGroup*)fl.Alloc(); |
| 965 | if (g) { |
| 966 | int resCount = 0; |
| 967 | for (auto ptr : g->Ptrs) { |
| 968 | if (ptr) |
| 969 | buf[resCount++] = ptr; |
| 970 | else |
| 971 | break; |
| 972 | } |
| 973 | blockFreeList.Free(g); |
| 974 | return resCount; |
| 975 | } |
| 976 | return 0; |
| 977 | } |
| 978 | |
| 979 | // add several blocks to global free list |
| 980 | static Y_FORCE_INLINE void PutBlocksToGlobalFreeList(ptrdiff_t nSizeIdx, char** buf, int count) { |
no test coverage detected