mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-23 11:58:03 +00:00
8223622: Move Universe usage out of memAllocator.hpp
Reviewed-by: coleenp, lkorinth
This commit is contained in:
parent
34c357ee6f
commit
2841f70585
@ -260,12 +260,12 @@ void MemAllocator::Allocation::notify_allocation() {
|
||||
|
||||
HeapWord* MemAllocator::allocate_outside_tlab(Allocation& allocation) const {
|
||||
allocation._allocated_outside_tlab = true;
|
||||
HeapWord* mem = _heap->mem_allocate(_word_size, &allocation._overhead_limit_exceeded);
|
||||
HeapWord* mem = Universe::heap()->mem_allocate(_word_size, &allocation._overhead_limit_exceeded);
|
||||
if (mem == NULL) {
|
||||
return mem;
|
||||
}
|
||||
|
||||
NOT_PRODUCT(_heap->check_for_non_bad_heap_word_value(mem, _word_size));
|
||||
NOT_PRODUCT(Universe::heap()->check_for_non_bad_heap_word_value(mem, _word_size));
|
||||
size_t size_in_bytes = _word_size * HeapWordSize;
|
||||
_thread->incr_allocated_bytes(size_in_bytes);
|
||||
|
||||
@ -322,7 +322,7 @@ HeapWord* MemAllocator::allocate_inside_tlab_slow(Allocation& allocation) const
|
||||
// Allocate a new TLAB requesting new_tlab_size. Any size
|
||||
// between minimal and new_tlab_size is accepted.
|
||||
size_t min_tlab_size = ThreadLocalAllocBuffer::compute_min_size(_word_size);
|
||||
mem = _heap->allocate_new_tlab(min_tlab_size, new_tlab_size, &allocation._allocated_tlab_size);
|
||||
mem = Universe::heap()->allocate_new_tlab(min_tlab_size, new_tlab_size, &allocation._allocated_tlab_size);
|
||||
if (mem == NULL) {
|
||||
assert(allocation._allocated_tlab_size == 0,
|
||||
"Allocation failed, but actual size was updated. min: " SIZE_FORMAT
|
||||
|
||||
@ -37,7 +37,6 @@ class MemAllocator: StackObj {
|
||||
protected:
|
||||
class Allocation;
|
||||
|
||||
CollectedHeap* const _heap;
|
||||
Thread* const _thread;
|
||||
Klass* const _klass;
|
||||
const size_t _word_size;
|
||||
@ -50,8 +49,7 @@ private:
|
||||
|
||||
protected:
|
||||
MemAllocator(Klass* klass, size_t word_size, Thread* thread)
|
||||
: _heap(Universe::heap()),
|
||||
_thread(thread),
|
||||
: _thread(thread),
|
||||
_klass(klass),
|
||||
_word_size(word_size)
|
||||
{ }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user