allocate multiple blocks, returns number of blocks allocated (max FL_GROUP_SIZE) buf should have space for at least FL_GROUP_SIZE elems
| 943 | // allocate multiple blocks, returns number of blocks allocated (max FL_GROUP_SIZE) |
| 944 | // buf should have space for at least FL_GROUP_SIZE elems |
| 945 | static Y_FORCE_INLINE int LFAllocNoCacheMultiple(int nSizeIdx, char** buf) { |
| 946 | int blockSize = nSizeIdxToSize[nSizeIdx]; |
| 947 | void* res = LFAllocFromCurrentChunk(nSizeIdx, blockSize, FL_GROUP_SIZE); |
| 948 | if (res) { |
| 949 | char* resPtr = (char*)res; |
| 950 | for (int k = 0; k < FL_GROUP_SIZE; ++k) { |
| 951 | buf[k] = resPtr; |
| 952 | resPtr += blockSize; |
| 953 | } |
| 954 | return FL_GROUP_SIZE; |
| 955 | } |
| 956 | buf[0] = (char*)SlowLFAlloc(nSizeIdx, blockSize, MEM_DEFRAG); |
| 957 | return 1; |
| 958 | } |
| 959 | |
| 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 |
no test coverage detected