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

Function duplicate_string

Source/ThirdParty/pugixml/pugixml.cpp:6772–6781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6770 size_t _length_heap;
6771
6772 static char_t* duplicate_string(const char_t* string, size_t length, xpath_allocator* alloc)
6773 {
6774 char_t* result = static_cast<char_t*>(alloc->allocate((length + 1) * sizeof(char_t)));
6775 assert(result);
6776
6777 memcpy(result, string, length * sizeof(char_t));
6778 result[length] = 0;
6779
6780 return result;
6781 }
6782
6783 xpath_string(const char_t* buffer, bool uses_heap_, size_t length_heap): _buffer(buffer), _uses_heap(uses_heap_), _length_heap(length_heap)
6784 {

Callers 2

from_heapFunction · 0.85
dataFunction · 0.85

Calls 2

memcpyFunction · 0.85
allocateMethod · 0.45

Tested by

no test coverage detected