mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
u/hashmap: Add "empty" function.
Used for cleanup assertions to start with: i.e. at some known point, the hash map should be empty.
This commit is contained in:
parent
4a4bed8df4
commit
821706e0e4
|
@ -73,6 +73,12 @@ u_hashmap_int_erase(struct u_hashmap_int *hmi, uint64_t key)
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool
|
||||
u_hashmap_int_empty(const struct u_hashmap_int *hmi)
|
||||
{
|
||||
return hmi->map.empty();
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
u_hashmap_int_clear_and_call_for_each(struct u_hashmap_int *hmi,
|
||||
u_hashmap_int_callback cb,
|
||||
|
|
|
@ -41,6 +41,12 @@ u_hashmap_int_insert(struct u_hashmap_int *hmi, uint64_t key, void *value);
|
|||
int
|
||||
u_hashmap_int_erase(struct u_hashmap_int *hmi, uint64_t key);
|
||||
|
||||
/*!
|
||||
* Is the hash map empty?
|
||||
*/
|
||||
bool
|
||||
u_hashmap_int_empty(const struct u_hashmap_int *hmi);
|
||||
|
||||
/*!
|
||||
* First clear the hashmap and then call the given callback with each item that
|
||||
* was in the hashmap.
|
||||
|
|
Loading…
Reference in a new issue