| 363 | } |
| 364 | |
| 365 | inline void* ThreadCache::Allocate(size_t size, size_t cl) { |
| 366 | ASSERT(size <= kMaxSize); |
| 367 | ASSERT(size == Static::sizemap()->ByteSizeForClass(cl)); |
| 368 | |
| 369 | FreeList* list = &list_[cl]; |
| 370 | if (list->empty()) { |
| 371 | //Beefy::DebugTimeGuard suspendTimeGuard(10, "ThreadCache::Allocate"); |
| 372 | return FetchFromCentralCache(cl, size); |
| 373 | } |
| 374 | size_ -= size; |
| 375 | return list->Pop(); |
| 376 | } |
| 377 | |
| 378 | inline void ThreadCache::Deallocate(void* ptr, size_t cl) { |
| 379 | FreeList* list = &list_[cl]; |
no test coverage detected