diff options
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/str_table.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/util/str_table.c b/lib/util/str_table.c index dba61fe..34aa70e 100644 --- a/lib/util/str_table.c +++ b/lib/util/str_table.c @@ -176,6 +176,14 @@ void str_table_add_ref(str_table_t *table, size_t index) bucket->refcount += 1; } +void str_table_del_ref(str_table_t *table, size_t index) +{ + str_bucket_t *bucket = bucket_by_index(table, index); + + if (bucket != NULL && bucket->refcount > 0) + bucket->refcount -= 1; +} + size_t str_table_get_ref_count(str_table_t *table, size_t index) { str_bucket_t *bucket = bucket_by_index(table, index); |