MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / alloc_string

Method alloc_string

lib/pugixml/src/pugixml.cpp:11215–11229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11213 }
11214
11215 const char_t* alloc_string(const xpath_lexer_string& value)
11216 {
11217 if (!value.begin)
11218 return PUGIXML_TEXT("");
11219
11220 size_t length = static_cast<size_t>(value.end - value.begin);
11221
11222 char_t* c = static_cast<char_t*>(_alloc->allocate((length + 1) * sizeof(char_t)));
11223 if (!c) return 0;
11224
11225 memcpy(c, value.begin, length * sizeof(char_t));
11226 c[length] = 0;
11227
11228 return c;
11229 }
11230
11231 xpath_ast_node* parse_function(const xpath_lexer_string& name, size_t argc, xpath_ast_node* args[2])
11232 {

Callers

nothing calls this directly

Calls 2

memcpyFunction · 0.85
allocateMethod · 0.45

Tested by

no test coverage detected