зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #5389 - Blanket impl JSTraceable on raw pointers (from Manishearth:trace_raw); r=jdm
Source-Repo: https://github.com/servo/servo Source-Revision: 5dd43bf84c78063b6eaf505cab253c1666d969ce
This commit is contained in:
Родитель
43c977e9b0
Коммит
ef4b90fe68
|
@ -137,6 +137,26 @@ 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> {
|
impl<T: JSTraceable+Copy> JSTraceable for Cell<T> {
|
||||||
fn trace(&self, trc: *mut JSTracer) {
|
fn trace(&self, trc: *mut JSTracer) {
|
||||||
self.get().trace(trc)
|
self.get().trace(trc)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче