Skip to content
Permalink
Browse files
8274988: G1: refine G1SegmentedArrayAllocOptions and G1CardSetAllocOp…
…tions

Reviewed-by: tschatzl, ayang
  • Loading branch information
Hamlin Li committed Oct 21, 2021
1 parent c7a80e6 commit a120937e8194a897ed4af9e7a2e33beb857987e5
Showing 2 changed files with 11 additions and 8 deletions.
@@ -39,6 +39,9 @@ class outputStream;
// Collects G1CardSetAllocator options/heuristics. Called by G1CardSetAllocator
// to determine the next size of the allocated G1CardSetBuffer.
class G1CardSetAllocOptions : public G1SegmentedArrayAllocOptions {
static const uint MinimumBufferSize = 8;
static const uint MaximumBufferSize = UINT_MAX / 2;

uint exponential_expand(uint prev_num_elems) const {
return clamp(prev_num_elems * 2, _initial_num_elems, _max_num_elems);
}
@@ -115,22 +115,22 @@ class G1SegmentedArrayBufferList {
class G1SegmentedArrayAllocOptions {

protected:
uint _elem_size;
uint _initial_num_elems;
const uint _elem_size;
const uint _initial_num_elems;
// Defines a limit to the number of elements in the buffer
uint _max_num_elems;
uint _alignment;

static const uint BufferAlignment = 4;
static const uint MinimumBufferSize = 8;
static const uint MaximumBufferSize = UINT_MAX / 2;
const uint _max_num_elems;
const uint _alignment;

public:
G1SegmentedArrayAllocOptions(uint elem_size, uint initial_num_elems, uint max_num_elems, uint alignment) :
_elem_size(elem_size),
_initial_num_elems(initial_num_elems),
_max_num_elems(max_num_elems),
_alignment(alignment) {
assert(_elem_size > 0, "Must be");
assert(_initial_num_elems > 0, "Must be");
assert(_max_num_elems > 0, "Must be");
assert(_alignment > 0, "Must be");
}

virtual uint next_num_elems(uint prev_num_elems) const {

1 comment on commit a120937

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on a120937 Oct 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.