From def25ea64b097d2a994eb33c91dc66248233afec Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 12 Mar 2022 19:13:54 +0100 Subject: Added freemem command --- src/commands.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/commands.c') diff --git a/src/commands.c b/src/commands.c index 1396b69..e704d7a 100644 --- a/src/commands.c +++ b/src/commands.c @@ -162,6 +162,7 @@ version_cmd = { Command *commands[] = { &commands_cmd, + &freemem_cmd, &gen_cmd, &help_cmd, &invert_cmd, @@ -508,8 +509,8 @@ gen_exec(CommandArgs *args) init_symcoord(); fprintf(stderr, "Generating pruning tables...\n"); - for (i = 0; allpd[i] != NULL; i++) - genptable(allpd[i], args->opts->nthreads); + for (i = 0; all_pd[i] != NULL; i++) + genptable(all_pd[i], args->opts->nthreads); fprintf(stderr, "Done!\n"); } @@ -547,13 +548,16 @@ commands_exec(CommandArgs *args) static void freemem_exec(CommandArgs *args) { -/* TODO: implement these functions - free_allpd(); - free_allsd(); - free_invtables(); - free_ttables(); - free_mtables(); -*/ + int i; + + for (i = 0; all_pd[i] != NULL; i++) + free_pd(all_pd[i]); + + for (i = 0; all_sd[i] != NULL; i++) + free_sd(all_sd[i]); + + /* TODO: invtables are also large, but for now they are * + * statically allocated. Consider releasing those too. */ } static void -- cgit v1.3