void *MSmall::Alloc(size_t sz) { if(sz <= 256) { ATIMING("Small alloc"); int k = ((int)sz + (sz == 0) - 1) >> 4; sHeapStat(k); return CheckFree(AllocK(k), k); }
inline void *Heap::Allok(int k) { // Try to alloc from the front-cache first FreeLink *ptr = cache[k]; if(ptr) { cachen[k]++; cache[k] = ptr->next; return DbgFreeCheckK(ptr, k); } return DbgFreeCheckK(AllocK(k), k); }
inline void *Heap::Allok(int k) { FreeLink *ptr = cache[k]; if(ptr) { cachen[k]++; cache[k] = ptr->next; return DbgFreeCheckK(ptr, k); } return DbgFreeCheckK(AllocK(k), k); }