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. */
| 186 | * associated data pointer. |
| 187 | * Returns the new node pointer. On out of memory NULL is returned. */ |
| 188 | raxNode *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. */ |
no outgoing calls
no test coverage detected