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 /execute.c | |
parent | 75421cbfe32ae6428fe08b6ba83f1f7ac0322c33 (diff) |
Add wrappers for malloc/realloc/free. See #43.
Diffstat (limited to 'execute.c')
-rw-r--r-- | execute.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -11,6 +11,7 @@ #include "forkable_stack.h" #include "frame_layout.h" +#include "jv_alloc.h" #include "locfile.h" #include "jv.h" #include "jv_aux.h" @@ -33,7 +34,7 @@ int path_push(stackval sv, jv val) { if (pos == pathsize) { int oldpathsize = pathsize; pathsize = oldpathsize ? oldpathsize * 2 : 100; - pathbuf = realloc(pathbuf, sizeof(pathbuf[0]) * pathsize); + pathbuf = jv_mem_realloc(pathbuf, sizeof(pathbuf[0]) * pathsize); for (int i=oldpathsize; i<pathsize; i++) { pathbuf[i] = jv_invalid(); } @@ -491,7 +492,7 @@ void jq_teardown() { for (int i=0; i<pathsize; i++) { jv_free(pathbuf[i]); } - free(pathbuf); + jv_mem_free(pathbuf); pathbuf = 0; pathsize = 0; } |