use crate::plan::barriers::BarrierSelector;
use crate::util::constants::*;
pub struct PlanConstraints {
pub moves_objects: bool,
pub gc_header_bits: usize,
pub gc_header_words: usize,
pub num_specialized_scans: usize,
pub max_non_los_default_alloc_bytes: usize,
pub max_non_los_copy_bytes: usize,
pub needs_log_bit: bool,
pub may_trace_duplicate_edges: bool,
pub barrier: BarrierSelector,
pub needs_linear_scan: bool,
pub needs_concurrent_workers: bool,
pub generate_gc_trace: bool,
pub needs_forward_after_liveness: bool,
}
impl PlanConstraints {
pub const fn default() -> Self {
PlanConstraints {
moves_objects: false,
gc_header_bits: 0,
gc_header_words: 0,
num_specialized_scans: 0,
max_non_los_default_alloc_bytes: MAX_INT,
max_non_los_copy_bytes: MAX_INT,
needs_linear_scan: SUPPORT_CARD_SCANNING || LAZY_SWEEP,
needs_concurrent_workers: false,
generate_gc_trace: false,
may_trace_duplicate_edges: false,
needs_forward_after_liveness: false,
needs_log_bit: false,
barrier: BarrierSelector::NoBarrier,
}
}
}
pub const DEFAULT_PLAN_CONSTRAINTS: PlanConstraints = PlanConstraints::default();
pub const MAX_NON_LOS_ALLOC_BYTES_COPYING_PLAN: usize = 16 << LOG_BYTES_IN_PAGE;