mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add untraceable! macro
This commit is contained in:
parent
3b7e07699e
commit
85f79290a6
3 changed files with 22 additions and 1 deletions
|
@ -33,7 +33,9 @@ use js::jsapi::{JSObject, JSTracer, JS_CallTracer, JSTRACE_OBJECT};
|
|||
use js::jsval::JSVal;
|
||||
|
||||
use libc;
|
||||
use url::Url;
|
||||
use std::mem;
|
||||
use std::num;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use serialize::{Encodable, Encoder};
|
||||
|
||||
|
|
|
@ -42,3 +42,19 @@ macro_rules! make_uint_getter(
|
|||
}
|
||||
);
|
||||
)
|
||||
|
||||
|
||||
/// For use on non-jsmanaged types
|
||||
/// Use #[jstraceable] on JS managed types
|
||||
macro_rules! untraceable(
|
||||
($($ty:ident),+) => (
|
||||
$(
|
||||
impl JSTraceable for $ty {
|
||||
#[inline]
|
||||
fn trace(&self, _: *mut JSTracer) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
)+
|
||||
);
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue