27
27
28
28
#include " gc/g1/g1CardSet.hpp"
29
29
#include " gc/g1/g1CardSetContainers.hpp"
30
- #include " gc/g1/g1SegmentedArray .hpp"
31
- #include " gc/g1/g1SegmentedArrayFreePool .hpp"
30
+ #include " gc/g1/g1MonotonicArena .hpp"
31
+ #include " gc/g1/g1MonotonicArenaFreePool .hpp"
32
32
#include " gc/shared/freeListAllocator.hpp"
33
33
#include " memory/allocation.hpp"
34
34
#include " utilities/growableArray.hpp"
@@ -37,8 +37,8 @@ class G1CardSetConfiguration;
37
37
class outputStream ;
38
38
39
39
// Collects G1CardSetAllocator options/heuristics. Called by G1CardSetAllocator
40
- // to determine the next size of the allocated G1CardSetSegment .
41
- class G1CardSetAllocOptions : public G1SegmentedArrayAllocOptions {
40
+ // to determine the next size of the allocated memory Segment .
41
+ class G1CardSetAllocOptions : public G1MonotonicArena ::AllocOptions {
42
42
static const uint MinimumNumSlots = 8 ;
43
43
static const uint MaximumNumSlots = UINT_MAX / 2 ;
44
44
@@ -50,30 +50,28 @@ class G1CardSetAllocOptions : public G1SegmentedArrayAllocOptions {
50
50
static const uint SlotAlignment = 8 ;
51
51
52
52
G1CardSetAllocOptions (uint slot_size, uint initial_num_slots = MinimumNumSlots, uint max_num_slots = MaximumNumSlots) :
53
- G1SegmentedArrayAllocOptions (mtGCCardSet, slot_size, initial_num_slots, max_num_slots, SlotAlignment) {
53
+ G1MonotonicArena::AllocOptions (mtGCCardSet, slot_size, initial_num_slots, max_num_slots, SlotAlignment) {
54
54
}
55
55
56
56
virtual uint next_num_slots (uint prev_num_slots) const override {
57
57
return exponential_expand (prev_num_slots);
58
58
}
59
59
};
60
60
61
- using G1CardSetSegment = G1SegmentedArraySegment;
62
-
63
- using G1CardSetFreeList = G1SegmentedArrayFreeList;
64
-
65
61
// Arena-like allocator for (card set) heap memory objects.
66
62
//
67
63
// Allocation occurs from an internal free list of objects first. If the free list is
68
- // empty then tries to allocate from the G1SegmentedArray .
64
+ // empty then tries to allocate from the G1MonotonicArena .
69
65
class G1CardSetAllocator {
70
- G1SegmentedArray _segmented_array;
66
+ using Segment = G1MonotonicArena::Segment;
67
+ using SegmentFreeList = G1MonotonicArena::SegmentFreeList;
68
+ G1MonotonicArena _arena;
71
69
FreeListAllocator _free_slots_list;
72
70
73
71
public:
74
72
G1CardSetAllocator (const char * name,
75
73
const G1CardSetAllocOptions* alloc_options,
76
- G1CardSetFreeList* free_segment_list );
74
+ SegmentFreeList* segment_free_list );
77
75
~G1CardSetAllocator ();
78
76
79
77
void * allocate ();
@@ -91,7 +89,7 @@ class G1CardSetAllocator {
91
89
uint num_segments () const ;
92
90
};
93
91
94
- using G1CardSetFreePool = G1SegmentedArrayFreePool ;
92
+ using G1CardSetFreePool = G1MonotonicArenaFreePool ;
95
93
96
94
class G1CardSetMemoryManager : public CHeapObj <mtGCCardSet> {
97
95
G1CardSetConfiguration* _config;
@@ -118,7 +116,7 @@ class G1CardSetMemoryManager : public CHeapObj<mtGCCardSet> {
118
116
size_t mem_size () const ;
119
117
size_t unused_mem_size () const ;
120
118
121
- G1SegmentedArrayMemoryStats memory_stats () const ;
119
+ G1MonotonicArenaMemoryStats memory_stats () const ;
122
120
};
123
121
124
122
#endif // SHARE_GC_G1_G1CARDSETMEMORY_HPP
0 commit comments