MCPcopy Create free account
hub / github.com/boostorg/json / reserve

Method reserve

include/boost/json/basic_parser_impl.hpp:218–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216
217template<class Handler>
218void
219basic_parser<Handler>::
220reserve()
221{
222 if(BOOST_JSON_LIKELY(
223 ! st_.empty()))
224 return;
225 // Reserve the largest stack we need,
226 // to avoid reallocation during suspend.
227 st_.reserve(
228 sizeof(state) + // document parsing state
229 (sizeof(state) +
230 sizeof(std::size_t)) * depth() + // array and object state + size
231 sizeof(state) + // value parsing state
232 sizeof(std::size_t) + // string size
233 sizeof(state)); // comment state
234}
235
236//----------------------------------------------------------
237//

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected