MapClear
Description
Clear all entries but retain allocated storage. Entries are deinitialized via the configured key_copy_deinit and value_copy_deinit handlers when present.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in,out | Hash map. |
Success
Returns to the caller. Length is 0 and all probe slots are marked empty; the entries table and states table remain allocated at the same capacity. When key_copy_deinit / value_copy_deinit are configured they have been invoked on every previously-occupied slot.
Failure
Function cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Map.Init.c:66:
MapInsertR(&map, 2, 20);
MapRemoveFirst(&map, 1);
MapClear(&map);
bool result = (reserved_capacity >= 32) && (MapCapacity(&map) == reserved_capacity) && (MapTombstones(&map) == 0) &&
Last updated on