Skip to content

Commit

Permalink
swiper: updating crossing map when sweeping
Browse files Browse the repository at this point in the history
  • Loading branch information
dinfuehr committed Jan 6, 2024
1 parent d91ca84 commit d1e1ae7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dora-runtime/src/gc/swiper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ fn forward_minor(object: Address, young: Region) -> Option<Address> {
}
}

#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Page(Address);

impl Page {
Expand Down
2 changes: 2 additions & 0 deletions dora-runtime/src/gc/swiper/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ impl<'a> FullCollector<'a> {
} else {
for free_region in free_regions {
fill_region_with(self.vm, free_region.start, free_region.end, true);
self.old
.update_crossing(free_region.start(), free_region.end());

self.old_protected.add_to_freelist(
self.vm,
Expand Down
3 changes: 2 additions & 1 deletion dora-runtime/src/gc/swiper/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ impl<'a> Verifier<'a> {
let object_end = curr.offset(size);

// Object is not supposed to cross page boundary.
let page = Page::from_address(curr);
let page_for_object = Page::from_address(curr);
assert_eq!(page, page_for_object);
assert!(object_end <= page.end());

if !object.is_filler(self.vm) {
Expand Down

0 comments on commit d1e1ae7

Please sign in to comment.