Add store into abstract machine struct

This commit is contained in:
2025-08-10 15:21:24 +01:00
parent b20a6749f7
commit d8e51b0aa0
18 changed files with 129 additions and 141 deletions

View File

@@ -1,14 +1,16 @@
#include "store.h"
#include "am.h"
#include <string.h>
void store_init(store_t *store)
void store_init(am_t *am)
{
memset(store, 0, sizeof(store_t));
store->free = store->buffer;
memset(&am->store, 0, sizeof(store_t));
am->store.free = am->store.buffer;
}
expr_t *store_alloc(store_t *store)
expr_t *store_alloc(am_t *am)
{
return store->free++;
return am->store.free++;
}