MCPcopy Create free account
hub / github.com/WheretIB/nullc / push_back

Method push_back

external/pugixml/pugixml.cpp:6219–6239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6217 }
6218
6219 void push_back(const xpath_node& node, xpath_allocator* alloc)
6220 {
6221 if (_end == _eos)
6222 {
6223 size_t capacity = static_cast<size_t>(_eos - _begin);
6224
6225 // get new capacity (1.5x rule)
6226 size_t new_capacity = capacity + capacity / 2 + 1;
6227
6228 // reallocate the old array or allocate a new one
6229 xpath_node* data = static_cast<xpath_node*>(alloc->reallocate(_begin, capacity * sizeof(xpath_node), new_capacity * sizeof(xpath_node)));
6230 assert(data);
6231
6232 // finalize
6233 _begin = data;
6234 _end = data + capacity;
6235 _eos = data + new_capacity;
6236 }
6237
6238 *_end++ = node;
6239 }
6240
6241 void append(const xpath_node* begin, const xpath_node* end, xpath_allocator* alloc)
6242 {

Callers 2

step_pushMethod · 0.45
eval_node_setMethod · 0.45

Calls 2

assertFunction · 0.85
reallocateMethod · 0.80

Tested by

no test coverage detected