MCPcopy Create free account
hub / github.com/F-Stack/f-stack / raxNew

Function raxNew

app/redis-6.2.6/src/rax.c:203–215  ·  view source on GitHub ↗

Allocate a new rax and return its pointer. On out of memory the function * returns NULL. */

Source from the content-addressed store, hash-verified

201/* Allocate a new rax and return its pointer. On out of memory the function
202 * returns NULL. */
203rax *raxNew(void) {
204 rax *rax = rax_malloc(sizeof(*rax));
205 if (rax == NULL) return NULL;
206 rax->numele = 0;
207 rax->numnodes = 1;
208 rax->head = raxNewNode(0,0);
209 if (rax->head == NULL) {
210 rax_free(rax);
211 return NULL;
212 } else {
213 return rax;
214 }
215}
216
217/* realloc the node to make room for auxiliary data in order
218 * to store an item in that node. On out of memory NULL is returned. */

Callers 15

enableTrackingFunction · 0.85
trackingRememberKeysFunction · 0.85
initServerFunction · 0.85
resetErrorTableStatsFunction · 0.85
backupDbFunction · 0.85
slotToKeyFlushFunction · 0.85
clusterInitFunction · 0.85
ACLInitFunction · 0.85
ACLGetCommandIDFunction · 0.85

Calls 1

raxNewNodeFunction · 0.85

Tested by

no test coverage detected