summaryrefslogtreecommitdiff
path: root/utils/json-bench
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2011-12-19 09:56:35 +0000
committerManuel Klimek <klimek@google.com>2011-12-19 09:56:35 +0000
commit5b25cffdaed90512dcd858db5e71f37edc836c91 (patch)
treef5b957407e351d9431eab9f4dc263e146a3feb9f /utils/json-bench
parentd21428a5eba17d77c2df4af69ad6006f466ed1a5 (diff)
downloadllvm-5b25cffdaed90512dcd858db5e71f37edc836c91.tar.gz
llvm-5b25cffdaed90512dcd858db5e71f37edc836c91.tar.bz2
llvm-5b25cffdaed90512dcd858db5e71f37edc836c91.tar.xz
Allow for benchmarking more than 4GB of memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146864 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/json-bench')
-rw-r--r--utils/json-bench/JSONBench.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/json-bench/JSONBench.cpp b/utils/json-bench/JSONBench.cpp
index 810ebfcdef..dc2285dfa3 100644
--- a/utils/json-bench/JSONBench.cpp
+++ b/utils/json-bench/JSONBench.cpp
@@ -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"