Create a new stream data structure. */
| 65 | |
| 66 | /* Create a new stream data structure. */ |
| 67 | stream *streamNew(void) { |
| 68 | stream *s = zmalloc(sizeof(*s)); |
| 69 | s->rax = raxNew(); |
| 70 | s->length = 0; |
| 71 | s->last_id.ms = 0; |
| 72 | s->last_id.seq = 0; |
| 73 | s->cgroups = NULL; /* Created on demand to save memory when not used. */ |
| 74 | return s; |
| 75 | } |
| 76 | |
| 77 | /* Free a stream, including the listpacks stored inside the radix tree. */ |
| 78 | void freeStream(stream *s) { |
no test coverage detected