Automatically allocate memory as needed in parse

This commit is contained in:
John Keiser
2020-03-06 15:40:59 -08:00
parent 00f0859e1f
commit d140bc23f5
18 changed files with 317 additions and 202 deletions
-5
View File
@@ -59,11 +59,6 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
simdjson::ParsedJson pj;
bool allocok = pj.allocate_capacity(p.size(), 1024);
if (!allocok) {
std::cerr << "failed to allocate memory" << std::endl;
return EXIT_FAILURE;
}
int res =
simdjson::json_parse(p, pj); // do the parsing, return false on error
if (res) {