Files
thesis-lisp/vm/include/stack.h
T
2021-04-07 22:24:33 +03:00

15 lines
305 B
C

#pragma once
#include <stddef.h>
#include <stdint.h>
// uint64_t only
struct stack {
size_t sp, size;
uint64_t *data;
};
int stack_init(struct stack *st, size_t size);
void stack_free(struct stack *st);
int stack_push(struct stack *st, uint64_t w);
int stack_pop(struct stack *st, uint64_t *w);