Skip to content

Commit

Permalink
Upstream API change (#29)
Browse files Browse the repository at this point in the history
Related PR: mmtk/mmtk-core#897

Co-authored-by: Eduardo Souza <ledusou@gmail.com>
  • Loading branch information
wks and udesou authored Sep 11, 2023
1 parent f767db7 commit 94ae9c1
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 93 deletions.
118 changes: 59 additions & 59 deletions mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 1 addition & 15 deletions mmtk/src/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::sync::Mutex;

use libc::c_void;
use mmtk::util::ObjectReference;
use mmtk::{memory_manager, MMTK};
use mmtk::MMTK;

use crate::abi;
use crate::abi::RubyBindingOptions;
Expand Down Expand Up @@ -35,7 +35,6 @@ pub struct RubyBinding {
pub plan_name: Mutex<Option<CString>>,
pub weak_proc: WeakProcessor,
pub ppp_registry: PPPRegistry,
pub(crate) pinned_roots: Mutex<Vec<ObjectReference>>,
pub(crate) moved_givtbl: Mutex<HashMap<ObjectReference, MovedGIVTblEntry>>,
}

Expand All @@ -58,7 +57,6 @@ impl RubyBinding {
plan_name: Mutex::new(None),
weak_proc: WeakProcessor::new(),
ppp_registry: PPPRegistry::new(),
pinned_roots: Default::default(),
moved_givtbl: Default::default(),
}
}
Expand All @@ -77,16 +75,4 @@ impl RubyBinding {
}
plan_name.as_deref().unwrap().as_ptr()
}

pub(crate) fn unpin_pinned_roots(&self) {
let mut pinned_roots = self
.pinned_roots
.try_lock()
.expect("It is accessed during weak ref processing. Should have no race.");

for object in pinned_roots.drain(..) {
let result = memory_manager::unpin_object::<Ruby>(object);
debug_assert!(result);
}
}
}
Loading

0 comments on commit 94ae9c1

Please sign in to comment.