mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove JSTraceable implementation from RefCell.
The implementation wasn't really right, and we would rather just use DOMRefCell anyway.
This commit is contained in:
parent
db1163b1ec
commit
df7fb8fa32
11 changed files with 43 additions and 66 deletions
|
@ -66,7 +66,7 @@ use selectors::states::*;
|
|||
use serde::{Deserialize, Serialize};
|
||||
use smallvec::SmallVec;
|
||||
use std::boxed::FnBox;
|
||||
use std::cell::{Cell, RefCell, UnsafeCell};
|
||||
use std::cell::{Cell, UnsafeCell};
|
||||
use std::collections::hash_state::HashState;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::ffi::CString;
|
||||
|
@ -139,12 +139,6 @@ pub fn trace_object(tracer: *mut JSTracer, description: &str, obj: &Heap<*mut JS
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable> JSTraceable for RefCell<T> {
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
self.borrow().trace(trc)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable> JSTraceable for Rc<T> {
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
(**self).trace(trc)
|
||||
|
@ -157,26 +151,6 @@ impl<T: JSTraceable> JSTraceable for Box<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable> JSTraceable for *const T {
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
if !self.is_null() {
|
||||
unsafe {
|
||||
(**self).trace(trc)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable> JSTraceable for *mut T {
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
if !self.is_null() {
|
||||
unsafe {
|
||||
(**self).trace(trc)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: JSTraceable + Copy> JSTraceable for Cell<T> {
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
self.get().trace(trc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue