mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Use *mut T for the T* pointers in SpiderMonkey.
This commit is contained in:
parent
3e4b2c1c7b
commit
d5cb4377ef
18 changed files with 294 additions and 308 deletions
|
@ -69,17 +69,17 @@ impl<T: Reflectable> Drop for Temporary<T> {
|
|||
fn drop(&mut self) {
|
||||
let cx = cx_for_dom_object(&self.inner);
|
||||
unsafe {
|
||||
JS_RemoveObjectRoot(cx, self.inner.reflector().rootable());
|
||||
JS_RemoveObjectRoot(cx, self.inner.mut_reflector().rootable());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Reflectable> Temporary<T> {
|
||||
/// Create a new Temporary value from a JS-owned value.
|
||||
pub fn new(inner: JS<T>) -> Temporary<T> {
|
||||
pub fn new(mut inner: JS<T>) -> Temporary<T> {
|
||||
let cx = cx_for_dom_object(&inner);
|
||||
unsafe {
|
||||
JS_AddObjectRoot(cx, inner.reflector().rootable());
|
||||
JS_AddObjectRoot(cx, inner.mut_reflector().rootable());
|
||||
}
|
||||
Temporary {
|
||||
inner: inner,
|
||||
|
@ -351,7 +351,7 @@ impl<T: Assignable<U>, U: Reflectable> TemporaryPushable<T> for Vec<JS<U>> {
|
|||
|
||||
/// An opaque, LIFO rooting mechanism.
|
||||
pub struct RootCollection {
|
||||
roots: RefCell<Vec<*JSObject>>,
|
||||
roots: RefCell<Vec<*mut JSObject>>,
|
||||
}
|
||||
|
||||
impl RootCollection {
|
||||
|
@ -396,7 +396,7 @@ pub struct Root<'a, 'b, T> {
|
|||
/// Pointer to underlying Rust data
|
||||
ptr: RefCell<*mut T>,
|
||||
/// On-stack JS pointer to assuage conservative stack scanner
|
||||
js_ptr: *JSObject,
|
||||
js_ptr: *mut JSObject,
|
||||
}
|
||||
|
||||
impl<'a, 'b, T: Reflectable> Root<'a, 'b, T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue