@@ -12,21 +12,21 @@ namespace simdjson {
1212
1313// function pointer type for json_parse
1414using json_parse_functype = int (const uint8_t *buf, size_t len, ParsedJson &pj,
15- bool realloc_if_needed );
15+ bool realloc );
1616
1717// Pointer that holds the json_parse implementation corresponding to the
1818// available SIMD instruction set
1919extern std::atomic<json_parse_functype *> json_parse_ptr;
2020
2121int json_parse (const uint8_t *buf, size_t len, ParsedJson &pj,
22- bool realloc_if_needed ) {
23- return json_parse_ptr.load (std::memory_order_relaxed)(buf, len, pj, realloc_if_needed );
22+ bool realloc ) {
23+ return json_parse_ptr.load (std::memory_order_relaxed)(buf, len, pj, realloc );
2424}
2525
2626int json_parse (const char *buf, size_t len, ParsedJson &pj,
27- bool realloc_if_needed ) {
27+ bool realloc ) {
2828 return json_parse_ptr.load (std::memory_order_relaxed)(reinterpret_cast <const uint8_t *>(buf), len, pj,
29- realloc_if_needed );
29+ realloc );
3030}
3131
3232Architecture find_best_supported_implementation () {
@@ -50,7 +50,7 @@ Architecture find_best_supported_implementation() {
5050
5151// Responsible to select the best json_parse implementation
5252int json_parse_dispatch (const uint8_t *buf, size_t len, ParsedJson &pj,
53- bool realloc_if_needed ) {
53+ bool realloc ) {
5454 Architecture best_implementation = find_best_supported_implementation ();
5555 // Selecting the best implementation
5656 switch (best_implementation) {
@@ -72,18 +72,18 @@ int json_parse_dispatch(const uint8_t *buf, size_t len, ParsedJson &pj,
7272 return simdjson::UNEXPECTED_ERROR;
7373 }
7474
75- return json_parse_ptr.load (std::memory_order_relaxed)(buf, len, pj, realloc_if_needed );
75+ return json_parse_ptr.load (std::memory_order_relaxed)(buf, len, pj, realloc );
7676}
7777
7878std::atomic<json_parse_functype *> json_parse_ptr = &json_parse_dispatch;
7979
8080WARN_UNUSED
8181ParsedJson build_parsed_json (const uint8_t *buf, size_t len,
82- bool realloc_if_needed ) {
82+ bool realloc ) {
8383 ParsedJson pj;
8484 bool ok = pj.allocate_capacity (len);
8585 if (ok) {
86- json_parse (buf, len, pj, realloc_if_needed );
86+ json_parse (buf, len, pj, realloc );
8787 } else {
8888 std::cerr << " failure during memory allocation " << std::endl;
8989 }
0 commit comments