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
This commit is contained in:
Manuel Klimek 2011-12-19 09:56:35 +00:00
parent d21428a5eb
commit 5b25cffdae

View 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"