Skip to content

Commit

Permalink
hiding the Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubDoka committed Oct 3, 2024
1 parent 742a7ee commit 76bd940
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/ion/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub struct LiveRange {
pub vreg: VRegIndex,
pub bundle: LiveBundleIndex,
pub uses_spill_weight_and_flags: u32,
pub uses: UseList,
pub(crate) uses: UseList,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -198,7 +198,7 @@ impl Use {

#[derive(Clone, Debug)]
pub struct LiveBundle {
pub ranges: LiveRangeList,
pub(crate) ranges: LiveRangeList,
pub spillset: SpillSetIndex,
pub allocation: Allocation,
pub prio: u32, // recomputed after every bulk update
Expand Down Expand Up @@ -300,7 +300,7 @@ pub(crate) const MAX_SPLITS_PER_SPILLSET: u8 = 2;

#[derive(Clone, Debug)]
pub struct VRegData {
pub ranges: LiveRangeList,
pub(crate) ranges: LiveRangeList,
pub blockparam: Block,
// We don't initially know the RegClass until we observe a use of the VReg.
pub class: Option<RegClass>,
Expand Down Expand Up @@ -382,7 +382,7 @@ impl BlockparamIn {
}

impl LiveRanges {
pub fn add(&mut self, range: CodeRange, bump: Bump) -> LiveRangeIndex {
pub(crate) fn add(&mut self, range: CodeRange, bump: Bump) -> LiveRangeIndex {
self.push(LiveRange {
range,
vreg: VRegIndex::invalid(),
Expand All @@ -394,7 +394,7 @@ impl LiveRanges {
}

impl LiveBundles {
pub fn add(&mut self, bump: Bump) -> LiveBundleIndex {
pub(crate) fn add(&mut self, bump: Bump) -> LiveBundleIndex {
self.push(LiveBundle {
allocation: Allocation::none(),
ranges: LiveRangeList::new_in(bump),
Expand Down
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1670,10 +1670,8 @@ impl<T> VecExt<T> for Vec<T> {
}
}

/// Bump is a wrapper around `bumpalo::Bump` that can be cloned and also
/// implements `Allocator`. Using this avoids lifetime polution of `Ctx`.
#[derive(Debug, Clone, Default)]
pub struct Bump(Rc<bumpalo::Bump>);
pub(crate) struct Bump(Rc<bumpalo::Bump>);

impl Bump {
pub(crate) fn get_mut(&mut self) -> Option<&mut bumpalo::Bump> {
Expand Down

0 comments on commit 76bd940

Please sign in to comment.