aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode/vm.h
blob: 36547cbedb176de0b1ae6286878434d400145c23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef BDL_VM_H
#define BDL_VM_H

#include "types.h"
#include "chunk.h"

typedef struct VM {
    Chunk *chunk;
} VM;

VM vm_init(void);
void vm_free(VM vm);

VM
vm_init(void) {
    VM vm = {
        .chunk = chunk_init(),
    };
    return vm;
}

void
vm_free(VM vm) {
    chunk_free(vm.chunk);
}

#endif // BDL_VM_H