Adding dynamic memory allocation.

This commit is contained in:
Daniel Lemire
2018-12-06 21:44:26 -05:00
parent 8589a0588b
commit c2913d5d69
7 changed files with 93 additions and 24 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ int main(int argc, char *argv[]) {
}
if(verbose) cout << "[verbose] loaded " << filename << " ("<< p.size() << " bytes)" << endl;
ParsedJson pj;
bool allocok = pj.allocateCapacity(p.size(), 1024);
bool allocok = pj.allocateCapacity(p.size());
if(!allocok) {
std::cerr << "failed to allocate memory" << std::endl;
return EXIT_FAILURE;