Skip to content

Commit 4e06434

Browse files
authored
Fix incongruent defaults for copying GCs (#1296)
We change the max non-LOS allocation size to 8 KB.
1 parent 4a96a90 commit 4e06434

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/plan/plan_constraints.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl PlanConstraints {
5656
max_non_los_default_alloc_bytes: MAX_INT,
5757
max_non_los_copy_bytes: MAX_INT,
5858
// As `LAZY_SWEEP` is true, needs_linear_scan is true for all the plans. This is strange.
59-
// https://github.com/mmtk/mmtk-core/issues/1027 trackes the issue.
59+
// https://github.com/mmtk/mmtk-core/issues/1027 tracks the issue.
6060
needs_linear_scan: crate::util::constants::SUPPORT_CARD_SCANNING
6161
|| crate::util::constants::LAZY_SWEEP,
6262
needs_concurrent_workers: false,
@@ -69,9 +69,9 @@ impl PlanConstraints {
6969
}
7070
}
7171

72-
/// The default plan constraints. Each plan should define their own plan contraints.
72+
/// The default plan constraints. Each plan should define their own plan constraints.
7373
/// They can start from the default constraints and explicitly set some of the fields.
7474
pub(crate) const DEFAULT_PLAN_CONSTRAINTS: PlanConstraints = PlanConstraints::default();
7575

76-
// Use 16 pages as the size limit for non-LOS objects to avoid copying large objects
77-
pub const MAX_NON_LOS_ALLOC_BYTES_COPYING_PLAN: usize = 16 << LOG_BYTES_IN_PAGE;
76+
// Use two pages as the size limit for non-LOS objects to avoid copying large objects
77+
pub const MAX_NON_LOS_ALLOC_BYTES_COPYING_PLAN: usize = 2 << LOG_BYTES_IN_PAGE;

src/util/alloc/bumpallocator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use crate::util::conversions::bytes_to_pages_up;
99
use crate::util::opaque_pointer::*;
1010
use crate::vm::VMBinding;
1111

12-
const BYTES_IN_PAGE: usize = 1 << 12;
13-
const BLOCK_SIZE: usize = 8 * BYTES_IN_PAGE;
12+
/// Size of a bump allocator block. Currently it is set to 32 KB.
13+
const BLOCK_SIZE: usize = 8 << crate::util::constants::LOG_BYTES_IN_PAGE;
1414
const BLOCK_MASK: usize = BLOCK_SIZE - 1;
1515

1616
/// A bump pointer allocator. It keeps a thread local allocation buffer,

0 commit comments

Comments
 (0)