Update basics.md
This commit is contained in:
parent
9294e8b098
commit
156b1b20e3
|
@ -111,7 +111,7 @@ auto json = "[1,2,3]"_padded; // The _padded suffix creates a simdjson::padded_s
|
|||
ondemand::document doc = parser.iterate(json); // parse a string
|
||||
```
|
||||
|
||||
If you have a buffer of your own with enough padding already (SIMDJSON_PADDING extra bytes allocated), you can use `promise_padded` to pass it in:
|
||||
If you have a buffer of your own with enough padding already (SIMDJSON_PADDING extra bytes allocated), you can use `padded_string_view` to pass it in:
|
||||
|
||||
```c++
|
||||
ondemand::parser parser;
|
||||
|
@ -120,6 +120,9 @@ strcpy(json, "[1]");
|
|||
ondemand::document doc = parser.iterate(json, strlen(json), sizeof(json));
|
||||
```
|
||||
|
||||
We recommend against creating many `std::string` or many `std::padding_string` instances in your application to store your JSON data.
|
||||
Consider reusing the same buffers and limiting memory allocations.
|
||||
|
||||
Documents Are Iterators
|
||||
-----------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue