Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions src/policy/copyspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use crate::policy::space::{CommonSpace, Space};
use crate::scheduler::GCWorker;
use crate::util::alloc::allocator::AllocatorContext;
use crate::util::copy::*;
#[cfg(feature = "vo_bit")]
use crate::util::heap::layout::vm_layout::BYTES_IN_CHUNK;
use crate::util::heap::{MonotonePageResource, PageResource};
use crate::util::metadata::{extract_side_metadata, MetadataSpec};
use crate::util::object_forwarding;
Expand Down Expand Up @@ -189,19 +187,8 @@ impl<VM: VMBinding> CopySpace<VM> {

#[cfg(feature = "vo_bit")]
unsafe fn reset_vo_bit(&self) {
let current_chunk = self.pr.get_current_chunk();
if self.common.contiguous {
// If we have allocated something into this space, we need to clear its VO bit.
if current_chunk != self.common.start {
crate::util::metadata::vo_bit::bzero_vo_bit(
self.common.start,
current_chunk + BYTES_IN_CHUNK - self.common.start,
);
}
} else {
for (start, size) in self.pr.iterate_allocated_regions() {
crate::util::metadata::vo_bit::bzero_vo_bit(start, size);
}
for (start, size) in self.pr.iterate_allocated_regions() {
crate::util::metadata::vo_bit::bzero_vo_bit(start, size);
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/util/heap/monotonepageresource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ impl<VM: VMBinding> PageResource<VM> for MonotonePageResource<VM> {

/* In a contiguous space we can bump along into the next chunk, so preserve the currentChunk invariant */
if self.common().contiguous && chunk_align_down(sync.cursor) != sync.current_chunk {
debug_assert!(
chunk_align_down(sync.cursor) > sync.current_chunk,
"Not monotonic. chunk_align_down(sync.cursor): {}, sync.current_chunk: {}",
chunk_align_down(sync.cursor),
sync.current_chunk,
);
sync.current_chunk = chunk_align_down(sync.cursor);
}
self.commit_pages(reserved_pages, required_pages, tls);
Expand Down Expand Up @@ -310,6 +316,7 @@ impl<VM: VMBinding> MonotonePageResource<VM> {
MonotonePageResourceConditional::Contiguous { start: _start, .. } => _start,
_ => unreachable!(),
};
guard.current_chunk = guard.cursor;
} else if !guard.cursor.is_zero() {
let bytes = guard.cursor - guard.current_chunk;
self.release_pages_extent(guard.current_chunk, bytes);
Expand Down