Closed danielealbano closed 2 years ago
Merging #158 (280807a) into main (0f2d5f7) will increase coverage by
0.24%
. The diff coverage is91.89%
.
@@ Coverage Diff @@
## main #158 +/- ##
==========================================
+ Coverage 77.49% 77.74% +0.24%
==========================================
Files 92 93 +1
Lines 6163 6186 +23
==========================================
+ Hits 4776 4809 +33
+ Misses 1387 1377 -10
Impacted Files | Coverage Δ | |
---|---|---|
...ta_structures/hashtable/mcmp/hashtable_op_delete.c | 100.00% <ø> (ø) |
|
src/storage/db/storage_db.c | 43.71% <77.77%> (-0.51%) |
:arrow_down: |
src/data_structures/hashtable/mcmp/hashtable.c | 84.00% <100.00%> (ø) |
|
...rc/data_structures/hashtable/mcmp/hashtable_data.c | 82.69% <100.00%> (+8.40%) |
:arrow_up: |
...data_structures/hashtable/mcmp/hashtable_op_iter.c | 100.00% <100.00%> (ø) |
|
.../data_structures/hashtable/mcmp/hashtable_op_set.c | 100.00% <100.00%> (ø) |
|
...uctures/hashtable/mcmp/hashtable_support_op_arch.c | 93.77% <100.00%> (+1.54%) |
:arrow_up: |
... and 1 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 0f2d5f7...280807a. Read the comment docs.
This PR implements a new internal operation for the hashtable that allows to iterate over the available keys and values to simplify the code that disposes the keys and the values at the shutdown but will be used as well for frontend commands that require iteration over the keys and the values.
Specifically the storage_db_free has been refactored to be more readable and splitted in logical units, one of these take advantage of the new operation to iterate over the hashtable and dispose all the entry indexes, and hashtable_mcmp_data_free uses the new function to cleanup the keys at the shutdown.
The usage pattern is really simple, the function taks the hashtable and a bucket index as pointer which value has initially be set to 0, after each invocation, if the function doesn't return null, bucket_index has to be increased otherwise the current element will be found again.
The PR contains also some general style cleanups, the tests for the new command and a minor bugfix in a test for the spinlocks.