ResourceAreaChunk* Resources::new_chunk(fint min_capacity, ResourceAreaChunk* previous) { _in_consistent_state = false; ResourceAreaChunk* res = getFromFreeList(min_capacity); if (res) { res->initialize(previous); } else { res = new ResourceAreaChunk(min_capacity, previous); _allocated += res->capacity(); // Subtract the size of the resource chunk from the 'C-Heap' area. TrackCHeapInMonitor::adjust(-res->capacity()); } _in_consistent_state = true; return res; }
ResourceAreaChunk* Resources::new_chunk(int min_capacity, ResourceAreaChunk* previous) { _in_consistent_state = false; ResourceAreaChunk* res = getFromFreeList(min_capacity); if (res) { res->initialize(previous); } else { res = new ResourceAreaChunk(min_capacity, previous); _allocated += res->capacity(); if (PrintResourceChunkAllocation) { std->print("*allocating new resource area chunk of >=%d bytes, new total = %d bytes\n", min_capacity, _allocated); } } _in_consistent_state = true; assert(res, "just checking"); return res; }