1717#endif
1818
1919namespace simdjson {
20- // The function that users are expected to call is json_parse.
21- // We have more than one such function because we want to support several
22- // instruction sets.
23-
24- // function pointer type for json_parse
25- using json_parse_functype = int (const uint8_t *buf, size_t len, ParsedJson &pj,
26- bool realloc_if_needed);
27-
28- // Pointer that holds the json_parse implementation corresponding to the
29- // available SIMD instruction set
30- extern json_parse_functype *json_parse_ptr;
31-
3220// json_parse_implementation is the generic function, it is specialized for
3321// various architectures, e.g., as
3422// json_parse_implementation<Architecture::HASWELL> or
@@ -42,7 +30,7 @@ int json_parse_implementation(const uint8_t *buf, size_t len, ParsedJson &pj,
4230 bool reallocated = false ;
4331 if (realloc_if_needed) {
4432#if ALLOW_SAME_PAGE_BUFFER_OVERRUN
45- // realloc is needed if the end of the memory crosses a page
33+ // realloc is needed if the end of the memory crosses a page
4634#ifdef _MSC_VER
4735 SYSTEM_INFO sysInfo;
4836 GetSystemInfo (&sysInfo);
@@ -110,10 +98,8 @@ int json_parse_implementation(const uint8_t *buf, size_t len, ParsedJson &pj,
11098// realloc_if_needed is false, all bytes at and after buf + len are ignored
11199// (can be garbage). The ParsedJson object can be reused.
112100
113- inline int json_parse (const uint8_t *buf, size_t len, ParsedJson &pj,
114- bool realloc_if_needed = true ) {
115- return json_parse_ptr (buf, len, pj, realloc_if_needed);
116- }
101+ int json_parse (const uint8_t *buf, size_t len, ParsedJson &pj,
102+ bool realloc_if_needed = true );
117103
118104// Parse a document found in buf.
119105//
@@ -139,11 +125,8 @@ inline int json_parse(const uint8_t *buf, size_t len, ParsedJson &pj,
139125// buf should be readable up to buf + len + SIMDJSON_PADDING if
140126// realloc_if_needed is false, all bytes at and after buf + len are ignored
141127// (can be garbage). The ParsedJson object can be reused.
142- inline int json_parse (const char *buf, size_t len, ParsedJson &pj,
143- bool realloc_if_needed = true ) {
144- return json_parse_ptr (reinterpret_cast <const uint8_t *>(buf), len, pj,
145- realloc_if_needed);
146- }
128+ int json_parse (const char *buf, size_t len, ParsedJson &pj,
129+ bool realloc_if_needed = true );
147130
148131// We do not want to allow implicit conversion from C string to std::string.
149132int json_parse (const char *buf, ParsedJson &pj) = delete ;
0 commit comments