Fixed multiple bugs in hashmap implementation.
Some checks failed
clang-build / clang-build (push) Has been cancelled
gcc-build / gcc-build (push) Has been cancelled

1. Fixed infinite loop issue that occurred when map was full of
   tombstones;
2. Fixed bug related to tombstone count decrement when adding a new
   key on a deleted slot;
3. Added proper map resize when keys are added or removed;
4. Fixed inconsistent error messages;
5. Added proper NULL check on map_remove method.
This commit is contained in:
2025-11-25 10:58:30 +01:00
parent b885d93b6f
commit bbae7c587e
4 changed files with 171 additions and 36 deletions

View File

@@ -54,6 +54,7 @@ defined as follows:
typedef enum {
MAP_OK = 0x0,
MAP_ERR_ALLOCATE,
MAP_ERR_OVERFLOW,
MAP_ERR_INVALID,
MAP_ERR_NOT_FOUND
} map_status_t;