diff options
author | Guro Bokum <jiojiajiu@gmail.com> | 2015-03-06 00:17:37 +0700 |
---|---|---|
committer | Guro Bokum <jiojiajiu@gmail.com> | 2015-03-13 15:43:11 +0700 |
commit | 8de3c01fe4cc85dc25db049949a4dfd312e0c492 (patch) | |
tree | c54197b3ef8d8f2663e4d4e7039905c84426d042 | |
parent | 5f439e7eaa02245f64d5041d3d4e6dec51dfb993 (diff) | |
download | servo-8de3c01fe4cc85dc25db049949a4dfd312e0c492.tar.gz servo-8de3c01fe4cc85dc25db049949a4dfd312e0c492.zip |
RootCollection doesn't check if its SmallVec has spilled #5037
-rw-r--r-- | components/script/dom/bindings/js.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/bindings/js.rs b/components/script/dom/bindings/js.rs index 7ada9f45d14..ae09a8bf5b8 100644 --- a/components/script/dom/bindings/js.rs +++ b/components/script/dom/bindings/js.rs @@ -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}; @@ -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. @@ -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()), } } @@ -626,6 +626,7 @@ impl RootCollection { let roots = self.roots.get(); (*roots).push(untracked.js_ptr); debug!(" rooting {:?}", untracked.js_ptr); + assert!(!(*roots).spilled()); } } |