MapDeinit
Description
Release a map’s storage and zero its handle. Calls any configured key / value copy_deinit hooks on each live entry before freeing the entry array.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in,out | Pointer to a Map handle. |
Success
Returns to the caller. The handle is zeroed; all entries reclaimed through the configured allocator.
Failure
ValidateMap aborts via LOG_FATAL when m is NULL or uninitialised.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Debug.c:483:
// / fuzz, the memory cost is the documented trade-off.
if (self->live.allocator)
MapDeinit(&self->live);
if (self->freed.allocator)
VecDeinit(&self->freed);- In
Parse.c:31:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:65:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:98:
StrDeinit(&host_copy);
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:132:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:156:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Insert.c:40:
result = result && MapGetFirstPtr(&map, 3) && (*MapGetFirstPtr(&map, 3) == 30);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Insert.c:62:
result = result && !MapContainsPair(&map, 1, 10);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Insert.c:80:
result = result && MapGetFirstPtr(&map, 42) && (*MapGetFirstPtr(&map, 42) == 84);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Insert.c:112:
result = result && (MapPairCount(&map) >= 600);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Insert.c:134:
result = result && (MapValueCountForKey(&map, 8) == 1);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result; FloatDeinit(&probe);
FloatDeinit(&missing);
MapDeinit(&counts);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Foreach.c:40:
bool result = (key_sum == 12) && (value_sum == 125);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Foreach.c:79:
result = result && (all_value_sum == 292);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Deadend.c:40:
MapContainsPair(&map, 1, 10);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Map.Deadend.c:54:
MapRemovePair(&map, 1, 10);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Map.Deadend.c:68:
MapRemoveIf(&map, NULL, NULL);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Map.Deadend.c:82:
MapRetainIf(&map, NULL, NULL);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Map.Remove.c:36:
result = result && (MapPairCount(&map) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Remove.c:56:
result = result && (MapValueCountForKey(&map, 5) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Remove.c:84:
result = result && (MapPairCount(&map) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Remove.c:105:
result = result && (MapPairCount(&map) == 1);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Remove.c:126:
result = result && MapGetFirstPtr(&map, 105) && (*MapGetFirstPtr(&map, 105) == 205);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result; IntDeinit(&probe);
IntDeinit(&missing);
MapDeinit(&counts);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Access.c:41:
result = result && (MapUniqueKeyCount(&map) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Access.c:58:
result = result && (MapGetFirstPtr(&map, 999) == NULL);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Access.c:75:
result = result && (MapGetFirstPtr(&map, 999) == NULL);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Access.c:94:
result = result && !MapContainsKey(&map, 999);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Access.c:116:
int *value_ptr = MapValuePtrFromCursor(&map, cursor);
if (!value_ptr) {
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Map.Access.c:130:
result = result && (MapValuePtrFromCursor(&map, MapValueCursorInvalid()) == NULL);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Access.c:146:
cursor = MapFindFirstForKey(&map, 5);
if (!MapValueCursorIsValid(cursor)) {
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Map.Access.c:157:
result = result && MapGetFirstPtr(&map, 5) && (*MapGetFirstPtr(&map, 5) == 51);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Init.c:75:
result = result && MapGetFirstPtr(&map, 7) && (*MapGetFirstPtr(&map, 7) == 70);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Init.c:101:
}
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Init.c:132:
}
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result; }
MapDeinit(&index);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc); result = result && *MapGetFirstPtr(&counts, d) == 2;
MapDeinit(&counts);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc); BitVecDeinit(&probe);
BitVecDeinit(&missing);
MapDeinit(&counts);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Ops.c:65:
result = result && (value_count == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Ops.c:106:
result = result && (red_count == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Ops.c:143:
result = result && (MapPairCount(&second) == 2);
MapDeinit(&first);
MapDeinit(&second);
DefaultAllocatorDeinit(&alloc);- In
Map.Ops.c:144:
MapDeinit(&first);
MapDeinit(&second);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Ops.c:174:
result = result && (MapPairCount(&map) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Type.c:69:
MapPolicy(&map).max_probe_count == MapPolicyLinear.max_probe_count;
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Type.c:82:
MapKeyCompare(&map) == i32_compare && MapValueCompare(&map) == i32_compare && MapKeyHash(&map) == i32_hash;
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Map.Type.c:113:
MapPolicy(&map).next_index == custom_next_index && MapPolicy(&map).max_probe_count == 11;
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;
Last updated on