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

Method destroy

include/boost/json/detail/string_impl.hpp:238–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236 }
237
238 void
239 destroy(
240 storage_ptr const& sp) noexcept
241 {
242 if(s_.k == kind::string)
243 {
244 sp->deallocate(p_.t,
245 sizeof(table) +
246 p_.t->capacity + 1,
247 alignof(table));
248 }
249 else if(s_.k != key_string_)
250 {
251 // do nothing
252 }
253 else
254 {
255 BOOST_ASSERT(
256 s_.k == key_string_);
257 // VFALCO unfortunately the key string
258 // kind increases the cost of the destructor.
259 // This function should be skipped when using
260 // monotonic_resource.
261 sp->deallocate(k_.s, k_.n + 1);
262 }
263 }
264
265 BOOST_JSON_DECL
266 char*

Callers 5

~stringMethod · 0.80
~undoMethod · 0.80
~revert_constructMethod · 0.80
~cleanupMethod · 0.80
assignMethod · 0.80

Calls 1

deallocateMethod · 0.80

Tested by

no test coverage detected