Allocate a new non compressed node with the specified number of children. * If datafield 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. */
| 230 | * associated data pointer. |
| 231 | * Returns the new node pointer. On out of memory NULL is returned. */ |
| 232 | raxNode *raxNewNode(size_t children, int datafield) { |
| 233 | size_t nodesize = sizeof(raxNode)+children+raxPadding(children)+ |
| 234 | sizeof(raxNode*)*children; |
| 235 | if (datafield) nodesize += sizeof(void*); |
| 236 | raxNode *node = rax_malloc(nodesize); |
| 237 | if (node == NULL) return NULL; |
| 238 | node->iskey = 0; |
| 239 | node->isnull = 0; |
| 240 | node->iscompr = 0; |
| 241 | node->leafbitmap = 0; |
| 242 | node->size = children; |
| 243 | return node; |
| 244 | } |
| 245 | |
| 246 | /* Allocate a new rax and return its pointer. On out of memory the function |
| 247 | * returns NULL. */ |
no outgoing calls
no test coverage detected