| 227 | ~Block() {} |
| 228 | |
| 229 | void init(Block* _prev, Block* _next, int _objSize, ThreadData* _threadData) |
| 230 | { |
| 231 | prev = _prev; |
| 232 | if(prev) |
| 233 | prev->next = this; |
| 234 | next = _next; |
| 235 | if(next) |
| 236 | next->prev = this; |
| 237 | objSize = _objSize; |
| 238 | binIdx = mallocTables.bin(objSize); |
| 239 | threadData = _threadData; |
| 240 | privateFreeList = publicFreeList = 0; |
| 241 | bumpPtr = data; |
| 242 | int nobjects = MAX_BLOCK_SIZE/objSize; |
| 243 | endPtr = bumpPtr + nobjects*objSize; |
| 244 | almostEmptyThreshold = (nobjects + 1)/2; |
| 245 | allocated = 0; |
| 246 | } |
| 247 | |
| 248 | bool isFilled() const { return allocated > almostEmptyThreshold; } |
| 249 | |