mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Improve documentation for MutHeap and RootCollection.
This commit is contained in:
parent
84425bf4d7
commit
37584ab056
1 changed files with 8 additions and 2 deletions
|
@ -301,7 +301,9 @@ impl HeapGCValue for JSVal {
|
||||||
impl<T: Reflectable> HeapGCValue for JS<T> {
|
impl<T: Reflectable> HeapGCValue for JS<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A mutable holder for a GC-owned SpiderMonkey value stored on the heap.
|
/// A holder that provides interior mutability for GC-managed values such as
|
||||||
|
/// `JSVal` and `JS<T>`.
|
||||||
|
///
|
||||||
/// Must be used in place of traditional interior mutability to ensure proper
|
/// Must be used in place of traditional interior mutability to ensure proper
|
||||||
/// GC barriers are enforced.
|
/// GC barriers are enforced.
|
||||||
#[must_root]
|
#[must_root]
|
||||||
|
@ -600,7 +602,11 @@ impl<T: Assignable<U>, U: Reflectable> TemporaryPushable<T> for Vec<JS<U>> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An opaque, LIFO rooting mechanism.
|
/// An opaque, LIFO rooting mechanism. This tracks roots and ensures that they
|
||||||
|
/// are destructed in a LIFO order.
|
||||||
|
///
|
||||||
|
/// See also [*Exact Stack Rooting - Storing a GCPointer on the CStack*]
|
||||||
|
/// (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/GC/Exact_Stack_Rooting).
|
||||||
pub struct RootCollection {
|
pub struct RootCollection {
|
||||||
roots: UnsafeCell<SmallVec16<*mut JSObject>>,
|
roots: UnsafeCell<SmallVec16<*mut JSObject>>,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue