-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
/** ...
* @param realloc_if_needed Whether to reallocate and enlarge the JSON buffer to add padding.
* @return An element pointing at the root of the document, or an error:
* - MEMALLOC if realloc_if_needed is true or the parser does not have enough capacity,
* and memory allocation fails.
* - CAPACITY if the parser does not have enough capacity and len > max_capacity.
* - other json errors if parsing fails. You should not rely on these errors to always the same for the
* same document: they may vary under runtime dispatch (so they may vary depending on your system and hardware).
*/
inline simdjson_result<element> parse(const uint8_t *buf, size_t len, bool realloc_if_needed = true) & noexcept;If the capacity is at least 64 bytes larger than the string size, it's safe to avoid the extra copy and set realloc_if_needed=false, as long as the 64 bytes are initialized memory (any value) (not sure which architectures this matters for)
Metadata
Metadata
Assignees
Labels
No labels