Skip to content
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

Don't compare vtable pointers anymore #25918

Merged
merged 2 commits into from Mar 6, 2020
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Don't compare the vtable pointers anymore when unrooting stuff

  • Loading branch information
nox committed Mar 6, 2020
commit b5aa83f63314e3ff337c1888c818bf1b7c07a06e
@@ -262,7 +262,10 @@ impl RootCollection {
unsafe fn unroot(&self, object: *const dyn JSTraceable) {
debug_assert!(thread_state::get().is_script());
let roots = &mut *self.roots.get();
match roots.iter().rposition(|r| *r == object) {
match roots
.iter()
.rposition(|r| *r as *const () == object as *const ())
{
Some(idx) => {
roots.remove(idx);
},
@@ -891,7 +891,11 @@ impl RootedTraceableSet {
unsafe fn remove(traceable: *const dyn JSTraceable) {
ROOTED_TRACEABLES.with(|ref traceables| {
let mut traceables = traceables.borrow_mut();
let idx = match traceables.set.iter().rposition(|x| *x == traceable) {
let idx = match traceables
.set
.iter()
.rposition(|x| *x as *const () == traceable as *const ())
{
Some(idx) => idx,
None => unreachable!(),
};
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.