MCPcopy Create free account
hub / github.com/acl-dev/acl / calloc

Function calloc

test/libmm/memalloc.cpp:123–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void *calloc(size_t num, size_t nsize)
124{
125 size_t size;
126 void *block;
127 if (!num || !nsize)
128 return NULL;
129 size = num * nsize;
130 /* check mul overflow */
131 if (nsize != size / num)
132 return NULL;
133 block = mymalloc(size);
134 if (!block)
135 return NULL;
136 memset(block, 0, size);
137 return block;
138}
139
140void *realloc(void *block, size_t size)
141{

Callers 15

thread_mainFunction · 0.85
startFunction · 0.85
mainFunction · 0.85
host_addFunction · 0.85
service_addFunction · 0.85
resolver_addrinfo_allocFunction · 0.85
rfc1035_unpack2rrFunction · 0.85
rfc1035_response_unpackFunction · 0.85
rfc1035_request_unpackFunction · 0.85
save_addr2rrFunction · 0.85
queue_pushFunction · 0.85
mbox_createFunction · 0.85

Calls 1

mymallocFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…