symtable: sym_table_cleanup -> sym_table_free
This commit is contained in:
@@ -22,7 +22,7 @@ typedef struct
|
|||||||
|
|
||||||
void sym_table_init(sym_table_t *);
|
void sym_table_init(sym_table_t *);
|
||||||
char *sym_table_find(sym_table_t *, sv_t);
|
char *sym_table_find(sym_table_t *, sv_t);
|
||||||
void sym_table_cleanup(sym_table_t *);
|
void sym_table_free(sym_table_t *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ void sys_free(sys_t *sys)
|
|||||||
{
|
{
|
||||||
static_assert(NUM_TAGS == 5);
|
static_assert(NUM_TAGS == 5);
|
||||||
|
|
||||||
sym_table_cleanup(&sys->symtable);
|
sym_table_free(&sys->symtable);
|
||||||
if (sys->memory.size == 0)
|
if (sys->memory.size == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ char *sym_table_find(sym_table_t *table, sv_t sv)
|
|||||||
return ENTRY_GET(table, index).data;
|
return ENTRY_GET(table, index).data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sym_table_cleanup(sym_table_t *table)
|
void sym_table_free(sym_table_t *table)
|
||||||
{
|
{
|
||||||
// Iterate through the strings and free each of them.
|
// Iterate through the strings and free each of them.
|
||||||
sv_t current = {0};
|
sv_t current = {0};
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ void symtable_test(void)
|
|||||||
TEST(table.count == ARRSIZE(unique_words), "%lu == %lu", table.count,
|
TEST(table.count == ARRSIZE(unique_words), "%lu == %lu", table.count,
|
||||||
ARRSIZE(unique_words));
|
ARRSIZE(unique_words));
|
||||||
|
|
||||||
sym_table_cleanup(&table);
|
sym_table_free(&table);
|
||||||
TEST_PASSED();
|
TEST_PASSED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user