Bug 1196631 - Make JS::ubi::Node::size return 1 by default. r=sfink
authorNick Fitzgerald <fitzgen@gmail.com>
Thu, 27 Aug 2015 06:03:00 -0400
changeset 259694 4e90ae2e44ddb022823b6322ee674fc8cc5ca6af
parent 259693 053d760eb1cf9fd1b7c93f42188b57c985dceb67
child 259695 461098c64803456b37018d44a7b7c4f9586c053b
push id29287
push userryanvm@gmail.com
push dateFri, 28 Aug 2015 01:31:40 +0000
treeherdermozilla-central@87e23922be37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1196631
milestone43.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 1196631 - Make JS::ubi::Node::size return 1 by default. r=sfink The old default was zero, but one is a better default in a couple ways: (1) there are no zero-sized things in C++ so one is closer to the truth, and (2) it gives us an idea of what magnitude of space is consumed by node specializations which don't have a JS::ubi::Node::size override yet.
js/public/UbiNode.h
--- a/js/public/UbiNode.h
+++ b/js/public/UbiNode.h
@@ -490,18 +490,18 @@ 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.
-    virtual size_t size(mozilla::MallocSizeOf mallocSizeof) const { return 0; }
+    // |mfbt/MemoryReporting.h|.
+    virtual size_t 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.
     virtual UniquePtr<EdgeRange> edges(JSContext* cx, bool wantNames) const = 0;