Bug 1285302 - Add a note describing why 'JS::ubi::Size' is not size_t. r=jimb
authorNick Fitzgerald <fitzgen@gmail.com>
Thu, 07 Jul 2016 11:36:00 -0400
changeset 304166 e0711b79a474e3bdb3809cdbea14761ebcd94dee
parent 304165 83d9f275922858c133c957249bd415862f397f0b
child 304167 8f5af40eb3654406bd13abc5e310386075c515d0
push id30414
push usercbook@mozilla.com
push dateFri, 08 Jul 2016 09:59:01 +0000
treeherdermozilla-central@45682df2d2d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimb
bugs1285302
milestone50.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 1285302 - Add a note describing why 'JS::ubi::Size' is not size_t. r=jimb
js/public/UbiNode.h
--- a/js/public/UbiNode.h
+++ b/js/public/UbiNode.h
@@ -573,16 +573,21 @@ class Base {
     // This must always return Concrete<T>::concreteTypeName; we use that
     // pointer as a tag for this particular referent type.
     virtual const char16_t* typeName() const = 0;
 
     // Return the size of this node, in bytes. Include any structures that this
     // node owns exclusively that are not exposed as their own ubi::Nodes.
     // |mallocSizeOf| should be a malloc block sizing function; see
     // |mfbt/MemoryReporting.h|.
+    //
+    // Because we can use |JS::ubi::Node|s backed by a snapshot that was taken
+    // on a 64-bit platform when we are currently on a 32-bit platform, we
+    // cannot rely on |size_t| for node sizes. Instead, |Size| is uint64_t on
+    // all platforms.
     using Size = uint64_t;
     virtual Size size(mozilla::MallocSizeOf mallocSizeof) const { return 1; }
 
     // Return an EdgeRange that initially contains all the referent's outgoing
     // edges. The caller takes ownership of the EdgeRange.
     //
     // If wantNames is true, compute names for edges. Doing so can be expensive
     // in time and memory.