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.
This commit is contained in:
Nick Fitzgerald 2015-08-27 06:03:00 -04:00
Родитель 9b473303db
Коммит 2f4cac96c2
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -495,8 +495,8 @@ class Base {
// 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.