File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 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);
3233InterpretResult interpret (VM * vm , const char * source );
3334void push (VM * vm , Value value );
3435Value pop (VM * vm );
36+ Value peek (VM * vm , int offset );
3537
3638bool is_falsey (Value value );
3739bool 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 );
4042void collect_garbage (VM * vm );
41- void mark_object (VM * vm , Object * object );
43+ void mark_object (VM * vm , Obj * object );
4244void mark_value (VM * vm , Value value );
43- void runtime_error (const char * format , ...);
45+ void runtime_error (VM * vm , const char * format , ...);
4446void free_objects (VM * vm );
4547bool compile (const char * source , Chunk * chunk );
46- Value peek (int offset );
4748
4849#endif
You can’t perform that action at this time.
0 commit comments