Move from Jansson to JV - everything but the interpreter loop
Passes valgrind --leak-check=full.
This commit is contained in:
1 parent
22f8aed31e
commit
2cb9a6e61d
12 files changed
+170
-123
No files matched your search
+6
-3
@@ -1,11 +1,11 @@
|
||||
#ifndef BYTECODE_H
|
||||
#define BYTECODE_H
|
||||
#include <jansson.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "jv.h"
|
||||
#include "opcode.h"
|
||||
|
||||
typedef void (*cfunction_ptr)(json_t* input[], json_t* output[]);
|
||||
typedef void (*cfunction_ptr)(jv input[], jv output[]);
|
||||
|
||||
struct cfunction {
|
||||
cfunction_ptr fptr;
|
||||
@@ -33,7 +33,7 @@ struct bytecode {
|
||||
int nlocals;
|
||||
int nclosures;
|
||||
|
||||
json_t* constants;
|
||||
jv constants; // JSON array of constants
|
||||
struct symbol_table* globals;
|
||||
|
||||
struct bytecode** subfunctions;
|
||||
@@ -46,4 +46,7 @@ void dump_disassembly(int, struct bytecode* code);
|
||||
void dump_code(int, struct bytecode* code);
|
||||
void dump_operation(struct bytecode* bc, uint16_t* op);
|
||||
|
||||
void symbol_table_free(struct symbol_table* syms);
|
||||
void bytecode_free(struct bytecode* bc);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user