Create simple, bump allocator store
This commit is contained in:
14
lib/store.c
Normal file
14
lib/store.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "store.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
void store_init(store_t *store)
|
||||
{
|
||||
memset(store, 0, sizeof(store_t));
|
||||
store->free = store->buffer;
|
||||
}
|
||||
|
||||
expr_t *store_alloc(store_t *store)
|
||||
{
|
||||
return store->free++;
|
||||
}
|
||||
Reference in New Issue
Block a user