Skip to content

Commit 900d73d

Browse files
authored
Update vm.h
1 parent 794a7a5 commit 900d73d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

vm.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define VM_H
33

44
#include "bloat.h"
5+
#include "object.h"
56
#include "chunk.h"
67
#include "value.h"
78

@@ -16,7 +17,7 @@ typedef struct {
1617
uint8_t* ip;
1718
Value stack[STACK_MAX];
1819
Value* stack_top;
19-
Object* objects;
20+
Obj* objects;
2021
size_t bytes_allocated;
2122
size_t next_gc;
2223
} VM;
@@ -32,17 +33,17 @@ void free_vm(VM* vm);
3233
InterpretResult interpret(VM* vm, const char* source);
3334
void push(VM* vm, Value value);
3435
Value pop(VM* vm);
36+
Value peek(VM* vm, int offset);
3537

3638
bool is_falsey(Value value);
3739
bool values_equal(Value a, Value b);
3840

39-
void* reallocate(void* pointer, size_t oldSize, size_t newSize);
41+
void* reallocate(VM* vm, void* pointer, size_t oldSize, size_t newSize);
4042
void collect_garbage(VM* vm);
41-
void mark_object(VM* vm, Object* object);
43+
void mark_object(VM* vm, Obj* object);
4244
void mark_value(VM* vm, Value value);
43-
void runtime_error(const char* format, ...);
45+
void runtime_error(VM* vm, const char* format, ...);
4446
void free_objects(VM* vm);
4547
bool compile(const char* source, Chunk* chunk);
46-
Value peek(int offset);
4748

4849
#endif

0 commit comments

Comments
 (0)