MCPcopy Index your code
hub / github.com/git/git / alloc_test_entry

Function alloc_test_entry

t/helper/test-hashmap.c:33–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33static struct test_entry *alloc_test_entry(unsigned int hash,
34 const char *key,
35 const char *value)
36{
37 size_t klen = strlen(key);
38 size_t vlen = strlen(value);
39 struct test_entry *entry = xmalloc(st_add4(sizeof(*entry), klen, vlen, 2));
40 hashmap_entry_init(&entry->ent, hash);
41 memcpy(entry->key, key, klen + 1);
42 memcpy(entry->key + klen + 1, value, vlen + 1);
43 return entry;
44}
45
46#define HASH_METHOD_FNV 0
47#define HASH_METHOD_I 1

Callers 1

perf_hashmapFunction · 0.70

Calls 2

hashmap_entry_initFunction · 0.85
xmallocFunction · 0.50

Tested by

no test coverage detected