MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / allocateKey

Function allocateKey

src/dictionary.cpp:12–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11
12static inline char* allocateKey(const char* key, size_t length) {
13 char* result = (char*)malloc(length + 1);
14 memcpy(result, key, length);
15 result[length] = 0;
16 return result;
17}
18
19static inline bool keyEquals(const char* candidate, const char* key, size_t length) {
20 return strncmp(candidate, key, length) == 0 && candidate[length] == 0;

Callers 1

lookupMethod · 0.85

Calls 1

mallocFunction · 0.85

Tested by

no test coverage detected