From 84bbc471523d100aa462428aacff5deb154fa04b Mon Sep 17 00:00:00 2001 From: Heng Li Date: Sat, 23 Sep 2017 10:43:22 -0400 Subject: [PATCH] two arrays should be freed with kfree(0,) though in the current code, they are strictly equivalent. --- index.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.c b/index.c index f772ab8..4bc4c35 100644 --- a/index.c +++ b/index.c @@ -196,7 +196,7 @@ static void worker_post(void *g, long i, int tid) assert(b->n == start_p); // deallocate and clear b->a - free(b->a.a); + kfree(0, b->a.a); b->a.n = b->a.m = 0, b->a.a = 0; } @@ -297,7 +297,7 @@ static void *worker_pipeline(void *shared, int step, void *in) } else if (step == 2) { // dispatch sketch to buckets step_t *s = (step_t*)in; mm_idx_add(p->mi, s->a.n, s->a.a); - free(s->a.a); free(s); + kfree(0, s->a.a); free(s); } return 0; }