aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode/vm.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-10-22 11:24:09 +0200
committerBad Diode <bd@badd10de.dev>2021-10-22 11:24:09 +0200
commitab7d7c155fb1bec5eed8f97462fbb656ea27dbb5 (patch)
treec0ab41a9078a67aa1fa9aa25a69942329200ea32 /src/bytecode/vm.h
parentf4113cbcdc192b23f9b6e5e14b0a3e4afac35272 (diff)
downloadbdl-ab7d7c155fb1bec5eed8f97462fbb656ea27dbb5.tar.gz
bdl-ab7d7c155fb1bec5eed8f97462fbb656ea27dbb5.zip
Add VM structure and fix AdressSanitizer bugs
Diffstat (limited to 'src/bytecode/vm.h')
-rw-r--r--src/bytecode/vm.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/bytecode/vm.h b/src/bytecode/vm.h
new file mode 100644
index 0000000..36547cb
--- /dev/null
+++ b/src/bytecode/vm.h
@@ -0,0 +1,27 @@
1#ifndef BDL_VM_H
2#define BDL_VM_H
3
4#include "types.h"
5#include "chunk.h"
6
7typedef struct VM {
8 Chunk *chunk;
9} VM;
10
11VM vm_init(void);
12void vm_free(VM vm);
13
14VM
15vm_init(void) {
16 VM vm = {
17 .chunk = chunk_init(),
18 };
19 return vm;
20}
21
22void
23vm_free(VM vm) {
24 chunk_free(vm.chunk);
25}
26
27#endif // BDL_VM_H