MCPcopy Create free account
hub / github.com/MyGUI/mygui / duplicate_string

Function duplicate_string

Tools/EditorFramework/pugixml.cpp:6536–6545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6534 bool _uses_heap;
6535
6536 static char_t* duplicate_string(const char_t* string, size_t length, xpath_allocator* alloc)
6537 {
6538 char_t* result = static_cast<char_t*>(alloc->allocate((length + 1) * sizeof(char_t)));
6539 assert(result);
6540
6541 memcpy(result, string, length * sizeof(char_t));
6542 result[length] = 0;
6543
6544 return result;
6545 }
6546
6547 static char_t* duplicate_string(const char_t* string, xpath_allocator* alloc)
6548 {

Callers 2

xpath_stringFunction · 0.70
dataFunction · 0.70

Calls 2

strlengthFunction · 0.70
allocateMethod · 0.45

Tested by

no test coverage detected