| 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* |
no test coverage detected