MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / dupString

Method dupString

common/script/scriptheap.cpp:88–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void* ScriptHeap::dupString(const std::string& str)
89{
90 // size() + 1 from data(): the terminator comes along, and so does any NUL
91 // inside the payload — web_get's body reaches the script this way.
92 char* ret = (char*)alloc(str.size() + 1);
93 if (ret) {
94 memcpy(ret, str.data(), str.size() + 1);
95 }
96 return (void*)ret;
97}
98
99void ScriptHeap::adopt(void* ptr, Deleter deleter)
100{

Callers 2

strToRetFunction · 0.80
handOverFunction · 0.80

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected