aboutsummaryrefslogtreecommitdiff
path: root/vm/main.c
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-11-01 20:08:40 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-11-01 20:08:40 +0000
commit0f295221cac3cfe507cafa6cbf012c51537ce1c8 (patch)
tree13e7aa6767a8774b4fcf1f5d2b3e7547fb5f551c /vm/main.c
parent525694bea7724d612a8b742943a0ed2aed5822f8 (diff)
downloadovm-0f295221cac3cfe507cafa6cbf012c51537ce1c8.tar.gz
ovm-0f295221cac3cfe507cafa6cbf012c51537ce1c8.tar.bz2
ovm-0f295221cac3cfe507cafa6cbf012c51537ce1c8.zip
VM runtime now maintains a heap internally
Now need to create some instructions which manage the heap
Diffstat (limited to 'vm/main.c')
-rw-r--r--vm/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vm/main.c b/vm/main.c
index 75549fd..cb2c3fb 100644
--- a/vm/main.c
+++ b/vm/main.c
@@ -55,10 +55,14 @@ int main(int argc, char *argv[])
byte *stack = calloc(stack_size, 1);
registers_t registers = {0};
darr_init(&registers, 8 * WORD_SIZE);
+ heap_t heap = {0};
+ heap_create(&heap);
+
vm_t vm = {0};
vm_load_stack(&vm, stack, stack_size);
vm_load_program(&vm, instructions, number);
vm_load_registers(&vm, registers);
+ vm_load_heap(&vm, heap);
#if VERBOSE >= 1
printf("\t[%sVM-SETUP%s]: Loaded stack and program into VM\n", TERM_GREEN,