#[non_exhaustive]pub struct Options {
pub live_budget: usize,
pub keep_assignment: bool,
}Expand description
Allocation settings.
§Examples
use backend_lang::regalloc::Options;
let o = Options::new().with_live_budget(1 << 20).keep_assignment(true);
assert_eq!(o.live_budget, 1 << 20);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.live_budget: usizeThe most live-set entries (values live into a block, summed over
blocks) the allocator builds before giving up with
RegAllocError::TooLarge.
keep_assignment: boolWhether to keep the final virtual function and its assignment in the
Allocation (for checking an allocation independently; it costs a
copy of the function).
Implementations§
Source§impl Options
impl Options
Sourcepub const fn new() -> Options
pub const fn new() -> Options
The defaults: DEFAULT_LIVE_BUDGET, no assignment kept.
§Examples
use backend_lang::regalloc::Options;
assert!(!Options::new().keep_assignment);Sourcepub const fn with_live_budget(self, entries: usize) -> Options
pub const fn with_live_budget(self, entries: usize) -> Options
Sets the live-set budget.
§Examples
use backend_lang::regalloc::Options;
assert_eq!(Options::new().with_live_budget(10).live_budget, 10);Sourcepub const fn keep_assignment(self, keep: bool) -> Options
pub const fn keep_assignment(self, keep: bool) -> Options
Keeps the final virtual function and assignment.
§Examples
use backend_lang::regalloc::Options;
assert!(Options::new().keep_assignment(true).keep_assignment);Trait Implementations§
impl Copy for Options
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more