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

Function raxNewNode

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

Allocate a new non compressed node with the specified number of children. * If datafiled is true, the allocation is made large enough to hold the * associated data pointer. * Returns the new node pointer. On out of memory NULL is returned. */

Source from the content-addressed store, hash-verified

186 * associated data pointer.
187 * Returns the new node pointer. On out of memory NULL is returned. */
188raxNode *raxNewNode(size_t children, int datafield) {
189 size_t nodesize = sizeof(raxNode)+children+raxPadding(children)+
190 sizeof(raxNode*)*children;
191 if (datafield) nodesize += sizeof(void*);
192 raxNode *node = rax_malloc(nodesize);
193 if (node == NULL) return NULL;
194 node->iskey = 0;
195 node->isnull = 0;
196 node->iscompr = 0;
197 node->size = children;
198 return node;
199}
200
201/* Allocate a new rax and return its pointer. On out of memory the function
202 * returns NULL. */

Callers 4

raxNewFunction · 0.85
raxAddChildFunction · 0.85
raxCompressNodeFunction · 0.85
raxGenericInsertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected