summaryrefslogtreecommitdiffstats
path: root/execute.c
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-12-18 16:52:47 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-12-18 16:53:51 +0000
commit04daafbde36ab696069a9df17ff85629574491c4 (patch)
tree66bff8def53de1a0f27038d880bd1306dc2ced39 /execute.c
parent75421cbfe32ae6428fe08b6ba83f1f7ac0322c33 (diff)
Add wrappers for malloc/realloc/free. See #43.
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/execute.c b/execute.c
index 8b8036a1..a4719aae 100644
--- a/execute.c
+++ b/execute.c
@@ -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;
}