mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update docs
This commit is contained in:
parent
cc44a3b064
commit
5336dd9853
2 changed files with 11 additions and 15 deletions
|
@ -13,13 +13,13 @@
|
|||
//! through `ProxyTraps.trace` otherwise.)
|
||||
//! 2. `_trace` calls `Foo::trace()` (an implementation of `JSTraceable`).
|
||||
//! This is typically derived via a #[jstraceable] annotation
|
||||
//! 4. For all fields (except those wrapped in `Untraceable`), `Foo::trace()`
|
||||
//! 3. For all fields (except those wrapped in `Untraceable`), `Foo::trace()`
|
||||
//! calls `trace()` on the field.
|
||||
//! For example, for fields of type `JS<T>`, `JS<T>::trace()` calls
|
||||
//! `trace_reflector()`.
|
||||
//! 6. `trace_reflector()` calls `trace_object()` with the `JSObject` for the
|
||||
//! 4. `trace_reflector()` calls `trace_object()` with the `JSObject` for the
|
||||
//! reflector.
|
||||
//! 7. `trace_object()` calls `JS_CallTracer()` to notify the GC, which will
|
||||
//! 5. `trace_object()` calls `JS_CallTracer()` to notify the GC, which will
|
||||
//! add the object to the graph, and will trace that object as well.
|
||||
//!
|
||||
//! The untraceable!() macro adds an empty implementation of JSTraceable to
|
||||
|
@ -44,11 +44,6 @@ use std::collections::hashmap::HashMap;
|
|||
use collections::hash::Hash;
|
||||
use style::PropertyDeclarationBlock;
|
||||
|
||||
// IMPORTANT: We rely on the fact that we never attempt to encode DOM objects using
|
||||
// any encoder but JSTracer. Since we derive trace hooks automatically,
|
||||
// we are unfortunately required to use generic types everywhere and
|
||||
// unsafely cast to the concrete JSTracer we actually require.
|
||||
|
||||
impl<T: Reflectable> JSTraceable for JS<T> {
|
||||
fn trace(&self, trc: *mut JSTracer) {
|
||||
trace_reflector(trc, "", self.reflector());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue