Skip to content

Always conservatively scan task stacks. Fix get_lo_object_size #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion mmtk/src/object_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ pub unsafe fn get_so_object_size(object: ObjectReference) -> usize {
#[inline(always)]
pub unsafe fn get_lo_object_size(object: ObjectReference) -> usize {
let obj_address = object.to_raw_address();
let julia_big_object = obj_address.to_ptr::<_bigval_t>();
let julia_big_object = (obj_address - std::mem::size_of::<_bigval_t>()).to_ptr::<_bigval_t>();
(*julia_big_object).sz
}

Expand Down
8 changes: 4 additions & 4 deletions mmtk/src/scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ impl Scanning<JuliaVM> for VMScanning {
pthread
);
// Conservative scan stack and registers. If the task hasn't been started, we do not need to scan its stack and registers.
// Note: we tried to skip the conservative scanning if the task is not started (task.start). However, it turned out that
// the stack may be used by the runtime before the task is started. So we have to scan the stack conservatively.
unsafe {
if (*task).start == crate::jl_true {
crate::conservative::mmtk_conservative_scan_task_stack(task);
crate::conservative::mmtk_conservative_scan_task_registers(task);
}
crate::conservative::mmtk_conservative_scan_task_stack(task);
crate::conservative::mmtk_conservative_scan_task_registers(task);
}

if task_is_root {
Expand Down
Loading