Allocate a new rax and return its pointer. On out of memory the function * returns NULL. */
| 201 | /* Allocate a new rax and return its pointer. On out of memory the function |
| 202 | * returns NULL. */ |
| 203 | rax *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. */ |
no test coverage detected