Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Flags
safe-html, strict-same
Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
A monotonic resource may be optionally constructed with an initial buffer to use first, before going to the heap. This allows the caller to use stack space and avoid dynamic allocations for most parsed JSON, falling back to dynamic allocation from the heap if the input JSON is larger than average, as shown here:单调资源在构造时可选择性地指定一个初始缓冲区,优先使用该缓冲区,之后才会转而使用堆内存。这使得调用方可以利用栈空间,避免对大多数 JSON 解析进行动态分配;仅当输入的 JSON 大于平均水平时,才会退回到从堆中进行动态分配,如下所示: