mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
Automatically allocate memory as needed in parse
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user