MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / append

Method append

Source/ThirdParty/pugixml/pugixml.cpp:7877–7899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7875 }
7876
7877 void append(const xpath_node* begin_, const xpath_node* end_, xpath_allocator* alloc)
7878 {
7879 if (begin_ == end_) return;
7880
7881 size_t size_ = static_cast<size_t>(_end - _begin);
7882 size_t capacity = static_cast<size_t>(_eos - _begin);
7883 size_t count = static_cast<size_t>(end_ - begin_);
7884
7885 if (size_ + count > capacity)
7886 {
7887 // reallocate the old array or allocate a new one
7888 xpath_node* data = static_cast<xpath_node*>(alloc->reallocate(_begin, capacity * sizeof(xpath_node), (size_ + count) * sizeof(xpath_node)));
7889 assert(data);
7890
7891 // finalize
7892 _begin = data;
7893 _end = data + size_;
7894 _eos = data + size_ + count;
7895 }
7896
7897 memcpy(_end, begin_, count * sizeof(xpath_node));
7898 _end += count;
7899 }
7900
7901 void sort_do()
7902 {

Callers 2

eval_node_setMethod · 0.45

Calls 2

memcpyFunction · 0.85
reallocateMethod · 0.80

Tested by

no test coverage detected