nissy-nx

A Rubik's cube optimal solver
git clone https://git.tronto.net/nissy-nx
Download | Log | Files | Refs | README | LICENSE

commit f6df8471931faeac7be76b8cdedc6daa48ab961d
parent ecd8bbf2c0b7a4ca20c9cdc5f8f26836d4082c36
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Mon,  7 Mar 2022 10:12:05 +0100

Set up for adding freemem command

Diffstat:
MTODO.md | 5+++--
Msrc/commands.c | 22++++++++++++++++++++++
Msrc/shell.c | 2++
3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -5,8 +5,7 @@ It's more of a personal reminder than anything else. ## For version 2.1 ### Memory management -* Free large tables from memory before exit (this is not strictly necessary, - but can help with WSL bugs) +* freemem command: implement the 5 functions, execute at the end of shell.c ### Installation * Is it possible to make table generation at least 3x faster? ### Documentation @@ -40,6 +39,8 @@ including e.g. solutions that were not shown because -c) * transform alg, rufify etc... * command notation to list available moves * make multi-step solve much more general and create command +* input directly cube status instead of moves + (graphical: maybe there is a cubing.js function; command line: ???) ## Distribution diff --git a/src/commands.c b/src/commands.c @@ -18,6 +18,7 @@ static void solve_exec(CommandArgs *args); static void scramble_exec(CommandArgs *args); static void steps_exec(CommandArgs *args); static void commands_exec(CommandArgs *args); +static void freemem_exec(CommandArgs *args); static void print_exec(CommandArgs *args); static void twophase_exec(CommandArgs *args); static void help_exec(CommandArgs *args); @@ -88,6 +89,15 @@ commands_cmd = { }; Command +freemem_cmd = { + .name = "freemem", + .usage = "freemem", + .description = "free large tables from RAM", + .parse_args = parse_no_arg, + .exec = freemem_exec, +}; + +Command print_cmd = { .name = "print", .usage = "print SCRAMBLE", @@ -535,6 +545,18 @@ commands_exec(CommandArgs *args) } static void +freemem_exec(CommandArgs *args) +{ +/* TODO: implement these functions + free_allpd(); + free_allsd(); + free_invtables(); + free_ttables(); + free_mtables(); +*/ +} + +static void print_exec(CommandArgs *args) { init_moves(); diff --git a/src/shell.c b/src/shell.c @@ -163,5 +163,7 @@ main(int argc, char *argv[]) launch(false); } + /* TODO: exec freemem */ + return 0; }