Allow for benchmarking more than 4GB of memory
authorManuel Klimek <klimek@google.com>
Mon, 19 Dec 2011 09:56:35 +0000 (09:56 +0000)
committerManuel Klimek <klimek@google.com>
Mon, 19 Dec 2011 09:56:35 +0000 (09:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146864 91177308-0d34-0410-b5e6-96231b3b80d8

utils/json-bench/JSONBench.cpp

index 810ebfcdefcda87ac1c9ca46cda54239e155fbe3..dc2285dfa3951568d8be01683e189c3ddd30fcb0 100644 (file)
@@ -23,7 +23,7 @@ Verify("verify", llvm::cl::desc(
          "Run a quick verification useful for regression testing"),
        llvm::cl::init(false));
 
-static llvm::cl::opt<unsigned>
+static llvm::cl::opt<size_t>
 MemoryLimitMB("memory-limit", llvm::cl::desc(
                 "Do not use more megabytes of memory"),
                  llvm::cl::init(1000));
@@ -49,11 +49,11 @@ void benchmark(llvm::TimerGroup &Group, llvm::StringRef Name,
   Parsing.stopTimer();
 }
 
-std::string createJSONText(unsigned MemoryMB, unsigned ValueSize) {
+std::string createJSONText(size_t MemoryMB, unsigned ValueSize) {
   std::string JSONText;
   llvm::raw_string_ostream Stream(JSONText);
   Stream << "[\n";
-  unsigned MemoryBytes = MemoryMB * 1024 * 1024;
+  size_t MemoryBytes = MemoryMB * 1024 * 1024;
   while (JSONText.size() < MemoryBytes) {
     Stream << " {\n"
            << "  \"key1\": \"" << std::string(ValueSize, '*') << "\",\n"