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

Function alloc_node

alloc.c:60–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60static inline void *alloc_node(struct alloc_state *s, size_t node_size)
61{
62 void *ret;
63
64 if (!s->nr) {
65 s->nr = BLOCKING;
66 s->p = xmalloc(BLOCKING * node_size);
67
68 ALLOC_GROW(s->slabs, s->slab_nr + 1, s->slab_alloc);
69 s->slabs[s->slab_nr++] = s->p;
70 }
71 s->nr--;
72 ret = s->p;
73 s->p = (char *)s->p + node_size;
74 memset(ret, 0, node_size);
75
76 return ret;
77}
78
79void *alloc_blob_node(struct repository *r)
80{

Callers 5

alloc_blob_nodeFunction · 0.85
alloc_tree_nodeFunction · 0.85
alloc_tag_nodeFunction · 0.85
alloc_object_nodeFunction · 0.85
alloc_commit_nodeFunction · 0.85

Calls 1

xmallocFunction · 0.70

Tested by

no test coverage detected