diff options
author | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-12-18 16:52:47 +0000 |
---|---|---|
committer | Stephen Dolan <mu@netsoc.tcd.ie> | 2012-12-18 16:53:51 +0000 |
commit | 04daafbde36ab696069a9df17ff85629574491c4 (patch) | |
tree | 66bff8def53de1a0f27038d880bd1306dc2ced39 /bytecode.c | |
parent | 75421cbfe32ae6428fe08b6ba83f1f7ac0322c33 (diff) |
Add wrappers for malloc/realloc/free. See #43.
Diffstat (limited to 'bytecode.c')
-rw-r--r-- | bytecode.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -4,6 +4,7 @@ #include "bytecode.h" #include "opcode.h" +#include "jv_alloc.h" static int bytecode_operation_length(uint16_t* codeptr) { int length = opcode_describe(*codeptr)->length; @@ -72,17 +73,17 @@ void dump_operation(struct bytecode* bc, uint16_t* codeptr) { } void symbol_table_free(struct symbol_table* syms) { - free(syms->cfunctions); - free(syms); + jv_mem_free(syms->cfunctions); + jv_mem_free(syms); } void bytecode_free(struct bytecode* bc) { - free(bc->code); + jv_mem_free(bc->code); jv_free(bc->constants); for (int i=0; i<bc->nsubfunctions; i++) bytecode_free(bc->subfunctions[i]); if (!bc->parent) symbol_table_free(bc->globals); - free(bc->subfunctions); - free(bc); + jv_mem_free(bc->subfunctions); + jv_mem_free(bc); } |