28 #include "memory/allocation.hpp" |
28 #include "memory/allocation.hpp" |
29 #include "memory/allocation.inline.hpp" |
29 #include "memory/allocation.inline.hpp" |
30 #include "memory/resourceArea.hpp" |
30 #include "memory/resourceArea.hpp" |
31 |
31 |
32 jint EpsilonHeap::initialize() { |
32 jint EpsilonHeap::initialize() { |
33 size_t init_byte_size = _policy->initial_heap_byte_size(); |
33 size_t align = _policy->heap_alignment(); |
34 size_t max_byte_size = _policy->max_heap_byte_size(); |
34 size_t init_byte_size = align_up(_policy->initial_heap_byte_size(), align); |
|
35 size_t max_byte_size = align_up(_policy->max_heap_byte_size(), align); |
35 |
36 |
36 // Initialize backing storage |
37 // Initialize backing storage |
37 ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size, _policy->heap_alignment()); |
38 ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size, align); |
38 _virtual_space.initialize(heap_rs, init_byte_size); |
39 _virtual_space.initialize(heap_rs, init_byte_size); |
39 |
40 |
40 MemRegion committed_region((HeapWord*)_virtual_space.low(), (HeapWord*)_virtual_space.high()); |
41 MemRegion committed_region((HeapWord*)_virtual_space.low(), (HeapWord*)_virtual_space.high()); |
41 MemRegion reserved_region((HeapWord*)_virtual_space.low_boundary(), (HeapWord*)_virtual_space.high_boundary()); |
42 MemRegion reserved_region((HeapWord*)_virtual_space.low_boundary(), (HeapWord*)_virtual_space.high_boundary()); |
42 |
43 |