HeapWord* PSPermGen::allocate_permanent(size_t size) { assert_locked_or_safepoint(Heap_lock); HeapWord* obj = allocate_noexpand(size, false); if (obj == NULL) { obj = expand_and_allocate(size, false); } return obj; }
// Allocation. We report all successful allocations to the size policy // Note that the perm gen does not use this method, and should not! HeapWord* PSOldGen::allocate(size_t word_size, bool is_large_noref, bool is_tlab) { assert_locked_or_safepoint(Heap_lock); HeapWord* res = allocate_noexpand(word_size, is_large_noref, is_tlab); if (res == NULL) { res = expand_and_allocate(word_size, is_large_noref, is_tlab); } // Allocations in the old generation need to be reported if (res != NULL) { ParallelScavengeHeap::size_policy()->tenured_allocation(word_size); } return res; }
HeapWord* PSOldGen::expand_and_allocate(size_t word_size, bool is_large_noref, bool is_tlab) { assert(!is_tlab, "TLAB's are not supported in PSOldGen"); expand(word_size*HeapWordSize); return allocate_noexpand(word_size, is_large_noref, is_tlab); }