Skip to content
Permalink
Browse files

8242211: Shenandoah: remove ShenandoahHeuristics::RegionData::_seqnum…

…_last_alloc

Reviewed-by: rkennke
  • Loading branch information
shipilev committed Apr 6, 2020
1 parent c4d01f8 commit 185f37212780f2a5cb71d548f5ddeac00a08ecf8
@@ -42,26 +42,6 @@ int ShenandoahHeuristics::compare_by_garbage(RegionData a, RegionData b) {
else return 0;
}

int ShenandoahHeuristics::compare_by_garbage_then_alloc_seq_ascending(RegionData a, RegionData b) {
int r = compare_by_garbage(a, b);
if (r != 0) {
return r;
}
return compare_by_alloc_seq_ascending(a, b);
}

int ShenandoahHeuristics::compare_by_alloc_seq_ascending(RegionData a, RegionData b) {
if (a._seqnum_last_alloc == b._seqnum_last_alloc)
return 0;
else if (a._seqnum_last_alloc < b._seqnum_last_alloc)
return -1;
else return 1;
}

int ShenandoahHeuristics::compare_by_alloc_seq_descending(RegionData a, RegionData b) {
return -compare_by_alloc_seq_ascending(a, b);
}

ShenandoahHeuristics::ShenandoahHeuristics() :
_region_data(NULL),
_region_data_size(0),
@@ -75,7 +75,6 @@ class ShenandoahHeuristics : public CHeapObj<mtGC> {
typedef struct {
ShenandoahHeapRegion* _region;
size_t _garbage;
uint64_t _seqnum_last_alloc;
} RegionData;

RegionData* _region_data;
@@ -97,9 +96,6 @@ class ShenandoahHeuristics : public CHeapObj<mtGC> {
ShenandoahSharedFlag _metaspace_oom;

static int compare_by_garbage(RegionData a, RegionData b);
static int compare_by_garbage_then_alloc_seq_ascending(RegionData a, RegionData b);
static int compare_by_alloc_seq_ascending(RegionData a, RegionData b);
static int compare_by_alloc_seq_descending(RegionData a, RegionData b);

RegionData* get_region_data_cache(size_t num);

0 comments on commit 185f372

Please sign in to comment.