We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
MonotonePageResource
1 parent 160b770 commit c320cf3Copy full SHA for c320cf3
src/util/heap/monotonepageresource.rs
@@ -350,7 +350,13 @@ impl<VM: VMBinding> MonotonePageResource<VM> {
350
} else {
351
let start = self.discontiguous_start;
352
self.discontiguous_start = self.pr.vm_map().get_next_contiguous_region(start);
353
- let size = self.pr.vm_map().get_contiguous_region_size(start);
+ // If the current cursor is within the current discontiguous region (i.e. chunk),
354
+ // then return the size till the cursor
355
+ let size = if self.pr.cursor().chunk_index() == start.chunk_index() {
356
+ self.pr.cursor() - start
357
+ } else {
358
+ self.pr.vm_map().get_contiguous_region_size(start)
359
+ };
360
Some((start, size))
361
}
362
0 commit comments