MCPcopy Create free account
hub / github.com/IoLanguage/io / Stack_new

Function Stack_new

libs/basekit/source/Stack.c:14–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#endif
13
14Stack *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
26void Stack_free(Stack *self) {
27 io_free(self->items);

Callers 4

IoState_new_atAddressFunction · 0.85
IoLexer_newFunction · 0.85
IoCoroutine_protoFunction · 0.85
IoCoroutine_rawCloneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected