Bug 1447795: Add even more UseItOrLoseIt to SmokeDMD.cpp
authorDavid Major <dmajor@mozilla.com>
Sun, 01 Apr 2018 09:37:42 -0400
changeset 411297 856ee0a0f633b5af4b2a09d40fe482147a9f79b7
parent 411296 3581cd72cde4998c0d7d19bc68b67c2b88b3d593
child 411298 83b9e0b2a4e75594a1c87f2d04a837bab38fa12b
push id33749
push usercsabou@mozilla.com
push dateMon, 02 Apr 2018 10:18:51 +0000
treeherdermozilla-central@c44f60c43432 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1447795
milestone61.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 1447795: Add even more UseItOrLoseIt to SmokeDMD.cpp
memory/replace/dmd/test/SmokeDMD.cpp
--- a/memory/replace/dmd/test/SmokeDMD.cpp
+++ b/memory/replace/dmd/test/SmokeDMD.cpp
@@ -62,28 +62,30 @@ UseItOrLoseIt(void* aPtr, int aSeven)
 
 // This function checks that heap blocks that have the same stack trace but
 // different (or no) reporters get aggregated separately.
 void Foo(int aSeven)
 {
   char* a[6];
   for (int i = 0; i < aSeven - 1; i++) {
     a[i] = (char*) malloc(128 - 16*i);
+    UseItOrLoseIt(a[i], aSeven);
   }
 
   // Oddly, some versions of clang will cause identical stack traces to be
   // generated for adjacent calls to Report(), which breaks the test. Inserting
   // the UseItOrLoseIt() calls in between is enough to prevent this.
 
   Report(a[2]);                     // reported
 
   UseItOrLoseIt(a[2], aSeven);
 
   for (int i = 0; i < aSeven - 5; i++) {
     Report(a[i]);                   // reported
+    UseItOrLoseIt(a[i], aSeven);
   }
 
   UseItOrLoseIt(a[2], aSeven);
 
   Report(a[3]);                     // reported
 
   // a[4], a[5] unreported
 }