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
Foreach.c:125:
}
MapDeinit(&index);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);- In
Foreach.c:165:
result = result && *MapGetFirstPtr(&counts, d) == 2;
MapDeinit(&counts);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);- In
Compare.c:241:
FloatDeinit(&probe);
FloatDeinit(&missing);
MapDeinit(&counts);
DefaultAllocatorDeinit(&alloc);
return result;- In
Compare.c:1071:
BitVecDeinit(&probe);
BitVecDeinit(&missing);
MapDeinit(&counts);
DefaultAllocatorDeinit(&alloc);
return result;- In
Compare.c:184:
IntDeinit(&probe);
IntDeinit(&missing);
MapDeinit(&counts);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:72:
result = result && (value_count == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:113:
result = result && (red_count == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:150:
result = result && (MapPairCount(&second) == 2);
MapDeinit(&first);
MapDeinit(&second);
DefaultAllocatorDeinit(&alloc);- In
Ops.c:151:
MapDeinit(&first);
MapDeinit(&second);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:196:
result = result && (MapPairCount(&map) == 0);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:225:
result = result && (MapUniqueKeyCount(&map) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:262:
result = result && (MapUniqueKeyCount(&map) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:285:
result = result && (MapPairCount(&map) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:311:
result = result && (MapValueCountForKey(&map, 0) == 1);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:77:
result = result && MapGetFirstPtr(&map, 7) && (*MapGetFirstPtr(&map, 7) == 70);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:103:
}
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:134:
}
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:153:
(MapCapacity(&map) == 0) && (MapTombstones(&map) == 0) && MapEmpty(&map);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:179:
}
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:197:
result = result && MapGetFirstPtr(&map, 2) && (*MapGetFirstPtr(&map, 2) == 20);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:214:
result = result && MapGetFirstPtr(&map, 6) && (*MapGetFirstPtr(&map, 6) == 60);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:240:
result = result && MapGetFirstPtr(&map, "alpha") && (ZstrCompare(*MapGetFirstPtr(&map, "alpha"), "first") == 0);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:267:
}
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:358:
result = result && MapGetFirstPtr(&map, 3) && (*MapGetFirstPtr(&map, 3) == 30);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:380:
result = result && !MapContainsPair(&map, 1, 10);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:409:
result = result && MapGetFirstPtr(&map, 1) && (*MapGetFirstPtr(&map, 1) == 10);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:438:
result = result && (MapPairCount(&map) == 1);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:456:
result = result && MapGetFirstPtr(&map, 42) && (*MapGetFirstPtr(&map, 42) == 84);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:478:
result = result && MapGetFirstPtr(&map, 42) && (*MapGetFirstPtr(&map, 42) == 84);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:500:
result = result && MapGetFirstPtr(&map, 11) && (*MapGetFirstPtr(&map, 11) == 110);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:531:
result = result && (MapPairCount(&map) == 1);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:565:
result = result && (MapPairCount(&map) == 664);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:587:
result = result && (MapValueCountForKey(&map, 8) == 1);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:611:
result = result && (MapPairCount(&map) == 1);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:641:
result = result && MapGetFirstPtr(&map, 1) && (*MapGetFirstPtr(&map, 1) == 11);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:696:
result = result && MapGetFirstPtr(&map, 5) && (*MapGetFirstPtr(&map, 5) == 55);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:723:
MapRehashWithPolicy(&map, 1, bad); // real: LOG_FATAL on the stuck-probe check
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Insert.c:741:
result = result && MapGetFirstPtr(&map, 5) && (*MapGetFirstPtr(&map, 5) == 50);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:757:
result = result && MapGetFirstPtr(&map, 7) && (*MapGetFirstPtr(&map, 7) == 70);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:773:
result = result && MapGetFirstPtr(&map, 9) && (*MapGetFirstPtr(&map, 9) == 90);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:787:
result = result && MapGetFirstPtr(&map, 11) && (*MapGetFirstPtr(&map, 11) == 110);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:812:
result = result && MapGetFirstPtr(&map, 3) && (*MapGetFirstPtr(&map, 3) == 30);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:833:
MapRehashWithPolicy(&map, 2, sab); // must LOG_FATAL "insufficient capacity"
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Insert.c:857:
result = result && MapGetFirstPtr(&map, k) && (*MapGetFirstPtr(&map, k) == k * 10);
MapDeinit(&map);
DefaultAllocatorDeinit(&inner);
return result;- In
Insert.c:885:
result = result && MapGetFirstPtr(&map, keys[i]) && (*MapGetFirstPtr(&map, keys[i]) == keys[i] + 1);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:940:
}
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:966:
}
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:985:
result = result && MapGetFirstPtr(&map, 7) && (*MapGetFirstPtr(&map, 7) == 71);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:1009:
result = result && (MapTombstones(&map) == 1);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:1048:
}
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:1069:
result = result && (MapCapacity(&map) >= 100);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:1096:
bool result = (MapCapacity(&map) == 16);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:1122:
result = result && MapGetFirstPtr(&map, 200) && (*MapGetFirstPtr(&map, 200) == 200);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:1141:
bool result = (MapCapacity(&map) == 8);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:1166:
result = result && MapGetFirstPtr(&map, 7) && (*MapGetFirstPtr(&map, 7) == 700);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:1195:
result = result && MapGetFirstPtr(&map, k) && (*MapGetFirstPtr(&map, k) == k * 100 + 3);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Type.c:70:
MapPolicy(&map).max_probe_count == MapPolicyLinear.max_probe_count;
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Type.c:83:
MapKeyCompare(&map) == i32_compare && MapValueCompare(&map) == i32_compare && MapKeyHash(&map) == i32_hash;
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Type.c:114:
MapPolicy(&map).next_index == custom_next_index && MapPolicy(&map).max_probe_count == 11;
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Type.c:154:
MapPolicy(&map).next_index == custom_next_index && MapPolicy(&map).max_probe_count == 13;
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Type.c:179:
MapAllocator(&map) == ALLOCATOR_OF(&alloc);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Deadend.c:91:
g->tombstones = real_tombs;
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Deadend.c:141:
ValidateMap(&map);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Deadend.c:159:
MapContainsPair(&map, 1, 10);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Deadend.c:173:
MapRemovePair(&map, 1, 10);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Deadend.c:187:
MapRemoveIf(&map, NULL, NULL);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Deadend.c:201:
MapRetainIf(&map, NULL, NULL);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Deadend.c:636:
result = result && MapGetFirstPtr(&map, 1) && (*MapGetFirstPtr(&map, 1) == 10);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Deadend.c:654:
MapPolicy policy = make_probe_policy(poly_next_index_stuck_at_cap8);
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc); // must LOG_FATAL
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Deadend.c:664:
MapPolicy policy = make_probe_policy(poly_next_index_stuck_at_golden);
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc); // must LOG_FATAL
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Deadend.c:674:
MapPolicy policy = make_probe_policy(poly_next_index_returns_first);
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc); // must LOG_FATAL
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Deadend.c:716:
g->length = real_length;
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:55:
result = result && MapGetFirstPtr(&map, 2) && (*MapGetFirstPtr(&map, 2) == 20);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:79:
result = result && MapContainsKey(&map, 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:99:
result = result && (MapValueCountForKey(&map, 5) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:128:
result = result && MapContainsPair(&map, 5, 51);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:174:
result = result && value && (*value == 51);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:190:
result = result && (MapPairCount(&map) == 0);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:206:
bool result = (removed == 0) && (MapPairCount(&map) == 0);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:228:
result = result && (MapPairCount(&map) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:249:
result = result && (MapPairCount(&map) == 1);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:273:
result = result && MapContainsKey(&map, 9);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:312:
result = result && MapGetFirstPtr(&map, 11) && (*MapGetFirstPtr(&map, 11) == 111);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Remove.c:358:
result = result && MapContainsKey(&map, "gamma");
MapDeinit(&map);
// After deinit, every clone and the table storage must be freed.
- In
Remove.c:399:
result = result && MapGetFirstPtr(&map, 0) && MapGetFirstPtr(&map, 3);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Foreach.c:40:
bool result = (key_sum == 12) && (value_sum == 125);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Foreach.c:79:
result = result && (all_value_sum == 292);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Foreach.c:117:
result = result && (key_sum_again == 12) && (value_sum_again == 125);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Foreach.c:149:
result = result && (after_sum == before_sum + 20);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Foreach.c:196:
bool result = (n == 0);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:103:
bool result = (MapValueCountForKey(&map, 0) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:138:
bool result = ok && (MapValuePtrFromCursor(&map, cursor) == NULL);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:163:
result = result && (MapUniqueKeyCount(&map) == 2);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:180:
result = result && (MapGetFirstPtr(&map, 999) == NULL);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:210:
result = result && !MapContainsPair(&map, 11, 110);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:240:
result = result && !MapContainsKey(&map, 7);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:259:
result = result && !MapContainsKey(&map, 999);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:281:
int *value_ptr = MapValuePtrFromCursor(&map, cursor);
if (!value_ptr) {
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Access.c:306:
result = result && !MapValueCursorIsValid(MapFindNextForKey(&map, 9, past));
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:322:
cursor = MapFindFirstForKey(&map, 5);
if (!MapValueCursorIsValid(cursor)) {
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return false;- In
Access.c:333:
result = result && MapGetFirstPtr(&map, 5) && (*MapGetFirstPtr(&map, 5) == 51);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:369:
result = result && !MapContainsPair(&map, 4, 999);
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:429:
}
MapDeinit(&map);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:26:
StrDeinit(&text);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return ok;- In
Parse.c:52:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:120:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:181:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:211:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:234:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:258:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:283:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:304:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:333:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:367:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:400:
StrDeinit(&host_copy);
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:434:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:458:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:501:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:553:
StrDeinit(&k_enabled);
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:586:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:620:
StrDeinit(&src);
MapDeinit(&cfg);
DefaultAllocatorDeinit(&alloc);
return result;- In
Parse.c:649:
StrDeinit(&text);
MapDeinit(&cfg);
ok = DebugAllocatorLiveCount(&dbg) == 0;- In
Parse.c:714:
StrDeinit(&text);
MapDeinit(&cfg);
// The stripped-away old value buffer must already be freed.
- In
Parse.c:745:
StrDeinit(&text);
MapDeinit(&cfg);
// The parser's local key copy must already be freed.
- In
Parse.c:775:
StrDeinit(&text);
MapDeinit(&cfg);
// The parser's local value copy must already be freed.
- In
Parse.c:816:
StrDeinit(&text);
MapDeinit(&cfg);
// Every transient lookup key must already be freed.
Last updated on