| 12 | #endif |
| 13 | |
| 14 | Stack *Stack_new(void) { |
| 15 | // size is the number of pointers, including the starting NULL. |
| 16 | int size = STACK_START_SIZE; |
| 17 | Stack *self = (Stack *)io_calloc(1, sizeof(Stack)); |
| 18 | self->items = (void **)io_calloc(1, size * sizeof(void *)); |
| 19 | // memEnd points past the end of the items memory block. |
| 20 | self->memEnd = self->items + size; |
| 21 | self->top = self->items; |
| 22 | // self->lastMark = self->items; |
| 23 | return self; |
| 24 | } |
| 25 | |
| 26 | void Stack_free(Stack *self) { |
| 27 | io_free(self->items); |
no outgoing calls
no test coverage detected