[Linux] Port MallocBench
[WebKit-https.git] / PerformanceTests / MallocBench / MallocBench / balloon.cpp
index 8c0d43f..070e860 100644 (file)
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#include "Benchmark.h"
 #include "CPUCount.h"
+#include "Memory.h"
 #include "balloon.h"
 #include <array>
 #include <chrono>
 #include <memory>
 #include <stddef.h>
+#include <strings.h>
 
 #include "mbmalloc.h"
 
@@ -61,7 +62,7 @@ void benchmark_balloon(CommandLine&)
     // Converts bytes to time -- for reporting's sake -- by waiting a while until
     // the heap shrinks back down. This isn't great for pooling with other
     // benchmarks in a geometric mean of throughput, but it's OK for basic testing.
-    while (Benchmark::currentMemoryBytes().resident > 2 * steadySize
+    while (currentMemoryBytes().resident > 2 * steadySize
         && std::chrono::steady_clock::now() - start < 8 * benchmarkTime) {
         for (size_t i = 0; i < steady.size(); ++i) {
             steady[i] = mbmalloc(chunkSize);