cli_registry: move from bptree to dict, fix memory leak

This commit is contained in:
Anna Antonenko
2025-04-08 18:05:08 +04:00
parent 9a6aa17bee
commit 4140952605
4 changed files with 29 additions and 41 deletions

View File

@@ -6,7 +6,7 @@
#pragma once
#include <furi.h>
#include <m-bptree.h>
#include <m-dict.h>
#include "cli_registry.h"
#ifdef __cplusplus
@@ -22,19 +22,9 @@ typedef struct {
size_t stack_depth;
} CliRegistryCommand;
#define CLI_COMMANDS_TREE_RANK 4
DICT_DEF2(CliCommandDict, FuriString*, FURI_STRING_OPLIST, CliRegistryCommand, M_POD_OPLIST);
// -V:BPTREE_DEF2:1103
// -V:BPTREE_DEF2:524
BPTREE_DEF2(
CliCommandTree,
CLI_COMMANDS_TREE_RANK,
FuriString*,
FURI_STRING_OPLIST,
CliRegistryCommand,
M_POD_OPLIST);
#define M_OPL_CliCommandTree_t() BPTREE_OPLIST2(CliCommandTree, FURI_STRING_OPLIST, M_POD_OPLIST)
#define M_OPL_CliCommandDict_t() DICT_OPLIST(CliCommandDict, FURI_STRING_OPLIST, M_POD_OPLIST)
bool cli_registry_get_command(
CliRegistry* registry,
@@ -48,7 +38,7 @@ void cli_registry_unlock(CliRegistry* registry);
/**
* @warning Surround calls to this function with `cli_registry_[un]lock`
*/
CliCommandTree_t* cli_registry_get_commands(CliRegistry* registry);
CliCommandDict_t* cli_registry_get_commands(CliRegistry* registry);
#ifdef __cplusplus
}