Bug 1248843 - Make it clearer that DebugOnly uses up space even in optimized, non-DEBUG builds. r=Waldo
authorJonathan Watt <jwatt@jwatt.org>
Fri, 19 Feb 2016 12:57:42 +0000
changeset 322800 083181144d0161c6c662c85d2d9d2e7b9638018e
parent 322799 36f909ca9e237d4589db53c9c22ded5b60c86bc6
child 322801 4b13eb25130fe814d7928d69fe63de43af3dd5d4
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1248843
milestone47.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 1248843 - Make it clearer that DebugOnly uses up space even in optimized, non-DEBUG builds. r=Waldo
mfbt/DebugOnly.h
--- a/mfbt/DebugOnly.h
+++ b/mfbt/DebugOnly.h
@@ -25,18 +25,19 @@ namespace mozilla {
  *   MOZ_ASSERT(check);
  *
  * more concisely than declaring |check| conditional on #ifdef DEBUG, but also
  * without allocating storage space for |check| in release builds.
  *
  * DebugOnly instances can only be coerced to T in debug builds.  In release
  * builds they don't have a value, so type coercion is not well defined.
  *
- * Note that DebugOnly instances still take up one byte of space, plus padding,
- * when used as members of structs.
+ * NOTE! DebugOnly instances still take up one byte of space, plus padding, even
+ * in optimized, non-DEBUG builds.  Don't use DebugOnly for struct/class members
+ * unless that really doesn't matter to you.
  */
 template<typename T>
 class DebugOnly
 {
 public:
 #ifdef DEBUG
   T value;