Skip to content

Commit

Permalink
RootCollection doesn't check if its SmallVec has spilled #5037
Browse files Browse the repository at this point in the history
  • Loading branch information
gurobokum committed Mar 13, 2015
1 parent 5f439e7 commit 8de3c01
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/script/dom/bindings/js.rs
Expand Up @@ -57,7 +57,7 @@ use js::jsval::JSVal;
use layout_interface::TrustedNodeAddress;
use script_task::STACK_ROOTS;

use util::smallvec::{SmallVec, SmallVec16};
use util::smallvec::{SmallVec, SmallVec24};

use core::nonzero::NonZero;
use std::cell::{Cell, UnsafeCell};
Expand Down Expand Up @@ -604,7 +604,7 @@ impl<T: Assignable<U>, U: Reflectable> TemporaryPushable<T> for Vec<JS<U>> {
/// See also [*Exact Stack Rooting - Storing a GCPointer on the CStack*]
/// (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/GC/Exact_Stack_Rooting).
pub struct RootCollection {
roots: UnsafeCell<SmallVec16<*mut JSObject>>,
roots: UnsafeCell<SmallVec24<*mut JSObject>>,
}

/// A pointer to a RootCollection, for use in global variables.
Expand All @@ -616,7 +616,7 @@ impl RootCollection {
/// Create an empty collection of roots
pub fn new() -> RootCollection {
RootCollection {
roots: UnsafeCell::new(SmallVec16::new()),
roots: UnsafeCell::new(SmallVec24::new()),
}
}

Expand All @@ -626,6 +626,7 @@ impl RootCollection {
let roots = self.roots.get();
(*roots).push(untracked.js_ptr);
debug!(" rooting {:?}", untracked.js_ptr);
assert!(!(*roots).spilled());
}
}

Expand Down

5 comments on commit 8de3c01

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at gurobokum@8de3c01

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging JIoJIaJIu/servo/gc = 8de3c01 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JIoJIaJIu/servo/gc = 8de3c01 merged ok, testing candidate = 52cc63a

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 52cc63a

Please sign in to comment.