Bug 860704 - GC: Comment says RawT converts to RootedT r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 12 Apr 2013 09:31:43 +0100
changeset 128573 a409636a0f32d89e16290d0692c61f78945245d0
parent 128572 006605c1ccc58c786b437d03869d52f18a81f53e
child 128574 e2344b2249db0610878f276a393175fc9eb3fd30
push id26396
push userjcoppeard@mozilla.com
push dateFri, 12 Apr 2013 10:18:55 +0000
treeherdermozilla-inbound@954c25a05631 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs860704
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 860704 - GC: Comment says RawT converts to RootedT r=terrence
js/public/RootingAPI.h
--- a/js/public/RootingAPI.h
+++ b/js/public/RootingAPI.h
@@ -44,26 +44,26 @@
  *
  * SpiderMonkey can trigger a GC at almost any time and in ways that are not
  * always clear. For example, the following innocuous-looking actions can
  * cause a GC: allocation of any new GC thing; JSObject::hasProperty;
  * JS_ReportError and friends; and ToNumber, among many others. The following
  * dangerous-looking actions cannot trigger a GC: js_malloc, cx->malloc_,
  * rt->malloc_, and friends and JS_ReportOutOfMemory.
  *
- * The following family of four classes will exactly root a stack location.
+ * The following family of three classes will exactly root a stack location.
  * Incorrect usage of these classes will result in a compile error in almost
  * all cases. Therefore, it is very hard to be incorrectly rooted if you use
  * these classes exclusively. These classes are all templated on the type T of
  * the value being rooted.
  *
  * - Rooted<T> declares a variable of type T, whose value is always rooted.
  *   Rooted<T> may be automatically coerced to a Handle<T>, below. Rooted<T>
  *   should be used whenever a local variable's value may be held live across a
- *   call which can trigger a GC. This is generally true of
+ *   call which can trigger a GC.
  *
  * - Handle<T> is a const reference to a Rooted<T>. Functions which take GC
  *   things or values as arguments and need to root those arguments should
  *   generally use handles for those arguments and avoid any explicit rooting.
  *   This has two benefits. First, when several such functions call each other
  *   then redundant rooting of multiple copies of the GC thing can be avoided.
  *   Second, if the caller does not pass a rooted value a compile error will be
  *   generated, which is quicker and easier to fix than when relying on a
@@ -85,26 +85,26 @@
  *
  * There also exists a set of RawT typedefs for modules without rooting
  * concerns, such as the GC. Do not use these as they provide no rooting
  * protection whatsoever.
  *
  * The following diagram explains the list of supported, implicit type
  * conversions between classes of this family:
  *
- *  RawT -----> Rooted<T> ----> Handle<T>
- *                 |               ^
- *                 |               |
- *                 |               |
- *                 +---> MutableHandle<T>
- *                 (via &)
+ *  Rooted<T> ----> Handle<T>
+ *     |               ^
+ *     |               |
+ *     |               |
+ *     +---> MutableHandle<T>
+ *     (via &)
  *
- * Currently all of these types implicit conversion to RawT. These are present
- * only for the purpose of bootstrapping exact rooting and will be removed in
- * the future (Bug 817164).
+ * Currently, all of these types have an implicit conversion to RawT. These are
+ * present only for the purpose of bootstrapping exact rooting and will be
+ * removed in the future (Bug 817164).
  */
 
 namespace js {
 
 class Module;
 
 template <typename T>
 struct RootMethods {};