From c5ffbb1f5e2364efd786eed106a68c964cc7ce59 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Sun, 19 Feb 2017 22:32:19 -0500 Subject: [PATCH] valgrind findings --- c/dsl/function_manager.c | 5 +---- c/todo.txt | 11 ++--------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/c/dsl/function_manager.c b/c/dsl/function_manager.c index 75bf955d3..3d4b3c33f 100644 --- a/c/dsl/function_manager.c +++ b/c/dsl/function_manager.c @@ -548,6 +548,7 @@ static udf_callsite_state_t* udf_callsite_state_alloc( pstate->args = mlr_malloc_or_die(pstate->arity * sizeof(boxed_xval_t)); for (i = 0; i < pstate->arity; i++) { + // Ownership will be transferred to local-stack which will be responsible for freeing. pstate->args[i] = box_ephemeral_val(mv_absent()); } @@ -568,10 +569,6 @@ static void udf_callsite_state_free(udf_callsite_state_t* pstate) { for (int i = 0; i < pstate->arity; i++) { rxval_evaluator_t* pxev = pstate->pevals[i]; pxev->pfree_func(pxev); - // xxx dup ownership w/ localstack? - if (pstate->args[i].is_ephemeral) { - mlhmmv_xvalue_free(&pstate->args[i].xval); - } } free(pstate->pevals); free(pstate->args); diff --git a/c/todo.txt b/c/todo.txt index f19fb0818..f2333926f 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -1,17 +1,11 @@ ================================================================ BUGFIXES -$ mlr --nidx --from data/english-words.txt put -q -f ngrams/ngfuncs.mlr -f ngrams/ng3.mlr -... -mlr(3541,0x7fffa963f3c0) malloc: *** error for object 0x7fe5190a0003: pointer being freed was not allocated -*** set a breakpoint in malloc_error_break to debug -Abort trap: 6 +:D ================================================================ 5.0.0 RELEASE TO DO: -! malloc bug @ ngrams ! - * UT * cookbook * other doc @@ -55,7 +49,7 @@ COOKBOOK CHECKLIST: ---------------------------------------------------------------- cook 1: -(done) +begin number nr andor cat -n -- maybe as faqent? ---------------------------------------------------------------- cook 2: fun stuff: @@ -263,7 +257,6 @@ func/subr: * cookbook examples file-formats page: -* --c2p, --c2j etc ... * --pprint --barred; emph for output only perf note: