MapPolicy
Description
Probing / rehash policy currently installed on m. The returned MapPolicy value is borrowed from inside the map – read-only.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in | Map. |
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Type.h:80:
MapPolicyNextIndexFn next_index;
size max_probe_count;
} MapPolicy;
///
- In
Type.h:89:
/// TAGS: Map, Constant, Policy
///
extern const MapPolicy MapPolicyLinear;
///
- In
Type.h:98:
/// TAGS: Map, Constant, Policy
///
extern const MapPolicy MapPolicyQuadratic;
typedef struct {- In
Type.h:117:
u8 *entries;
u8 *states;
MapPolicy policy;
Allocator *allocator;
u64 __magic;- In
Type.h:183:
MapEntry(K, V) * entries; \
u8 *states; \
MapPolicy policy; \
Allocator *allocator; \
u64 __magic; \
- In
Map.c:88:
}
void validate_map_policy(const MapPolicy *policy) {
static const struct {
u64 length;- In
Map.c:104:
if (!policy) {
LOG_FATAL("Expected a valid MapPolicy pointer");
}- In
Map.c:108:
if (!policy->name || !policy->name[0]) {
LOG_FATAL("MapPolicy must have a non-empty name");
}- In
Map.c:112:
if (!policy->should_rehash || !policy->next_capacity || !policy->first_index || !policy->next_index) {
LOG_FATAL("MapPolicy '{}' must provide all required callbacks", policy->name);
}- In
Map.c:116:
if (policy->max_probe_count == 0) {
LOG_FATAL("MapPolicy '{}' must provide a non-zero max_probe_count", policy->name);
}- In
Map.c:130:
if ((next0 == 0) && ((length != 0) || (capacity != 0) || (tombstones != 0))) {
LOG_FATAL("MapPolicy '{}' returned zero capacity for a non-empty snapshot", policy->name);
}- In
Map.c:134:
if ((next_same != 0) && (next_same < length)) {
LOG_FATAL("MapPolicy '{}' returned capacity smaller than current length", policy->name);
}- In
Map.c:138:
if (next_more < ((size)length + 1)) {
LOG_FATAL("MapPolicy '{}' returned capacity smaller than requested minimum entries", policy->name);
}
}- In
Map.c:151:
if (next == first) {
LOG_FATAL("MapPolicy '{}' produced a stuck probe sequence for capacity {}", policy->name, capacity);
}
}- In
Map.c:157:
}
MapPolicy validate_map_policy_copy(MapPolicy policy) {
validate_map_policy(&policy);
return policy;- In
Map.c:162:
}
const MapPolicy MapPolicyLinear = {
.name = "linear",
.should_rehash = default_should_rehash,- In
Map.c:171:
};
const MapPolicy MapPolicyQuadratic = {
.name = "quadratic",
.should_rehash = default_should_rehash,- In
Map.c:498:
size hash_offset,
size n,
MapPolicy policy
) {
u8 *old_entries;- In
Ops.c:98:
MapRehashWithPolicy(&map, MapPairCount(&map), MapPolicyQuadratic);
bool result = (MapPolicy(&map).first_index == MapPolicyQuadratic.first_index) &&
(MapPolicy(&map).next_index == MapPolicyQuadratic.next_index) &&
(MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity) &&- In
Ops.c:99:
bool result = (MapPolicy(&map).first_index == MapPolicyQuadratic.first_index) &&
(MapPolicy(&map).next_index == MapPolicyQuadratic.next_index) &&
(MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity) &&
(MapPolicy(&map).should_rehash == MapPolicyQuadratic.should_rehash);- In
Ops.c:100:
bool result = (MapPolicy(&map).first_index == MapPolicyQuadratic.first_index) &&
(MapPolicy(&map).next_index == MapPolicyQuadratic.next_index) &&
(MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity) &&
(MapPolicy(&map).should_rehash == MapPolicyQuadratic.should_rehash);
result = result && (MapValueCountForKey(&map, "red") == 2);- In
Ops.c:101:
(MapPolicy(&map).next_index == MapPolicyQuadratic.next_index) &&
(MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity) &&
(MapPolicy(&map).should_rehash == MapPolicyQuadratic.should_rehash);
result = result && (MapValueCountForKey(&map, "red") == 2);
result = result && MapGetFirstPtr(&map, "red") && (ZstrCompare(*MapGetFirstPtr(&map, "red"), "apple") == 0);- In
Ops.c:248:
// Policy is now quadratic (copied in by value).
result = result && (MapPolicy(&map).first_index == MapPolicyQuadratic.first_index);
result = result && (MapPolicy(&map).next_index == MapPolicyQuadratic.next_index);
result = result && (MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity);- In
Ops.c:249:
// Policy is now quadratic (copied in by value).
result = result && (MapPolicy(&map).first_index == MapPolicyQuadratic.first_index);
result = result && (MapPolicy(&map).next_index == MapPolicyQuadratic.next_index);
result = result && (MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity);
result = result && (MapPolicy(&map).should_rehash == MapPolicyQuadratic.should_rehash);- In
Ops.c:250:
result = result && (MapPolicy(&map).first_index == MapPolicyQuadratic.first_index);
result = result && (MapPolicy(&map).next_index == MapPolicyQuadratic.next_index);
result = result && (MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity);
result = result && (MapPolicy(&map).should_rehash == MapPolicyQuadratic.should_rehash);
// Tombstones gone, survivors intact, exact counts preserved.
- In
Ops.c:251:
result = result && (MapPolicy(&map).next_index == MapPolicyQuadratic.next_index);
result = result && (MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity);
result = result && (MapPolicy(&map).should_rehash == MapPolicyQuadratic.should_rehash);
// Tombstones gone, survivors intact, exact counts preserved.
result = result && (MapTombstones(&map) == 0);- In
Init.c:93:
MapRehashWithPolicy(&map, MapPairCount(&map), MapPolicyQuadratic);
bool result = (MapPolicy(&map).first_index == MapPolicyQuadratic.first_index) &&
(MapPolicy(&map).next_index == MapPolicyQuadratic.next_index) &&
(MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity) &&- In
Init.c:94:
bool result = (MapPolicy(&map).first_index == MapPolicyQuadratic.first_index) &&
(MapPolicy(&map).next_index == MapPolicyQuadratic.next_index) &&
(MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity) &&
(MapPolicy(&map).should_rehash == MapPolicyQuadratic.should_rehash);- In
Init.c:95:
bool result = (MapPolicy(&map).first_index == MapPolicyQuadratic.first_index) &&
(MapPolicy(&map).next_index == MapPolicyQuadratic.next_index) &&
(MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity) &&
(MapPolicy(&map).should_rehash == MapPolicyQuadratic.should_rehash);- In
Init.c:96:
(MapPolicy(&map).next_index == MapPolicyQuadratic.next_index) &&
(MapPolicy(&map).next_capacity == MapPolicyQuadratic.next_capacity) &&
(MapPolicy(&map).should_rehash == MapPolicyQuadratic.should_rehash);
for (int i = 0; i < 24; i++) {- In
Init.c:111:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy custom_policy = {
.name = "five-step",
.should_rehash = custom_should_rehash,- In
Init.c:127:
result = result && (MapCapacity(&map) == 10);
result = result && (MapPolicy(&map).next_capacity == custom_next_capacity);
for (int i = 0; i < 6; i++) {- In
Init.c:146:
// Fresh MapInit installs the linear policy by value and starts with
// an empty, unallocated probe table.
bool result = (MapPolicy(&map).should_rehash == MapPolicyLinear.should_rehash) &&
(MapPolicy(&map).next_capacity == MapPolicyLinear.next_capacity) &&
(MapPolicy(&map).first_index == MapPolicyLinear.first_index) &&- In
Init.c:147:
// an empty, unallocated probe table.
bool result = (MapPolicy(&map).should_rehash == MapPolicyLinear.should_rehash) &&
(MapPolicy(&map).next_capacity == MapPolicyLinear.next_capacity) &&
(MapPolicy(&map).first_index == MapPolicyLinear.first_index) &&
(MapPolicy(&map).next_index == MapPolicyLinear.next_index) &&- In
Init.c:148:
bool result = (MapPolicy(&map).should_rehash == MapPolicyLinear.should_rehash) &&
(MapPolicy(&map).next_capacity == MapPolicyLinear.next_capacity) &&
(MapPolicy(&map).first_index == MapPolicyLinear.first_index) &&
(MapPolicy(&map).next_index == MapPolicyLinear.next_index) &&
(MapPolicy(&map).max_probe_count == MapPolicyLinear.max_probe_count) && (MapPairCount(&map) == 0) &&- In
Init.c:149:
(MapPolicy(&map).next_capacity == MapPolicyLinear.next_capacity) &&
(MapPolicy(&map).first_index == MapPolicyLinear.first_index) &&
(MapPolicy(&map).next_index == MapPolicyLinear.next_index) &&
(MapPolicy(&map).max_probe_count == MapPolicyLinear.max_probe_count) && (MapPairCount(&map) == 0) &&
(MapCapacity(&map) == 0) && (MapTombstones(&map) == 0) && MapEmpty(&map);- In
Init.c:150:
(MapPolicy(&map).first_index == MapPolicyLinear.first_index) &&
(MapPolicy(&map).next_index == MapPolicyLinear.next_index) &&
(MapPolicy(&map).max_probe_count == MapPolicyLinear.max_probe_count) && (MapPairCount(&map) == 0) &&
(MapCapacity(&map) == 0) && (MapTombstones(&map) == 0) && MapEmpty(&map);- In
Insert.c:103:
}
static MapPolicy make_tight_policy(void) {
MapPolicy p = {0};
p.name = "tight-linear";- In
Insert.c:104:
static MapPolicy make_tight_policy(void) {
MapPolicy p = {0};
p.name = "tight-linear";
p.should_rehash = policy_should_rehash;- In
Insert.c:114:
}
static MapPolicy make_sabotage_policy(void) {
MapPolicy p = {0};
p.name = "sabotage-linear";- In
Insert.c:115:
static MapPolicy make_sabotage_policy(void) {
MapPolicy p = {0};
p.name = "sabotage-linear";
p.should_rehash = policy_should_rehash;- In
Insert.c:125:
}
static MapPolicy make_small_probe_policy(void) {
MapPolicy p = {0};
p.name = "small-probe-linear";- In
Insert.c:126:
static MapPolicy make_small_probe_policy(void) {
MapPolicy p = {0};
p.name = "small-probe-linear";
p.should_rehash = policy_should_rehash;- In
Insert.c:136:
}
static MapPolicy make_validate_only_reject_policy(void) {
MapPolicy p = {0};
p.name = "stuck-probe-huge-cap";- In
Insert.c:137:
static MapPolicy make_validate_only_reject_policy(void) {
MapPolicy p = {0};
p.name = "stuck-probe-huge-cap";
p.should_rehash = policy_should_rehash;- In
Insert.c:185:
}
static MapPolicy fill_then_grow_policy(void) {
MapPolicy policy = {
.name = "fill-then-grow",- In
Insert.c:186:
static MapPolicy fill_then_grow_policy(void) {
MapPolicy policy = {
.name = "fill-then-grow",
.should_rehash = grow_only_from_empty,- In
Insert.c:262:
}
static MapPolicy make_policy42(void) {
MapPolicy policy = {
.name = "const42",- In
Insert.c:263:
static MapPolicy make_policy42(void) {
MapPolicy policy = {
.name = "const42",
.should_rehash = policy42_should_rehash,- In
Insert.c:720:
MapInsertR(&map, 3, 30);
MapPolicy bad = make_validate_only_reject_policy();
MapRehashWithPolicy(&map, 1, bad); // real: LOG_FATAL on the stuck-probe check
- In
Insert.c:804:
MapInsertR(&map, 3, 30);
MapPolicy tight = make_tight_policy();
bool result = MapRehashWithPolicy(&map, 0, tight);- In
Insert.c:830:
MapInsertR(&map, k, k * 10);
MapPolicy sab = make_sabotage_policy();
MapRehashWithPolicy(&map, 2, sab); // must LOG_FATAL "insufficient capacity"
- In
Insert.c:869:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = make_small_probe_policy();
IntIntMap map = MapInitWithPolicy(i32_identity_hash, i32_compare, policy, &alloc);- In
Insert.c:951:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = fill_then_grow_policy();
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc);
bool result = true;- In
Insert.c:1025:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = {
.name = "tight-linear",
.should_rehash = load_rehash,- In
Insert.c:1059:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = make_policy42();
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc);- In
Insert.c:1181:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = fill_then_grow_policy();
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc);- In
Type.c:64:
MapEntries(&map) == NULL && MapStates(&map) == NULL && MapKeyCompare(&map) == i32_compare &&
MapValueCompare(&map) == NULL && MapKeyHash(&map) == i32_hash &&
MapPolicy(&map).should_rehash == MapPolicyLinear.should_rehash &&
MapPolicy(&map).next_capacity == MapPolicyLinear.next_capacity &&
MapPolicy(&map).first_index == MapPolicyLinear.first_index &&- In
Type.c:65:
MapValueCompare(&map) == NULL && MapKeyHash(&map) == i32_hash &&
MapPolicy(&map).should_rehash == MapPolicyLinear.should_rehash &&
MapPolicy(&map).next_capacity == MapPolicyLinear.next_capacity &&
MapPolicy(&map).first_index == MapPolicyLinear.first_index &&
MapPolicy(&map).next_index == MapPolicyLinear.next_index &&- In
Type.c:66:
MapPolicy(&map).should_rehash == MapPolicyLinear.should_rehash &&
MapPolicy(&map).next_capacity == MapPolicyLinear.next_capacity &&
MapPolicy(&map).first_index == MapPolicyLinear.first_index &&
MapPolicy(&map).next_index == MapPolicyLinear.next_index &&
MapPolicy(&map).max_probe_count == MapPolicyLinear.max_probe_count;- In
Type.c:67:
MapPolicy(&map).next_capacity == MapPolicyLinear.next_capacity &&
MapPolicy(&map).first_index == MapPolicyLinear.first_index &&
MapPolicy(&map).next_index == MapPolicyLinear.next_index &&
MapPolicy(&map).max_probe_count == MapPolicyLinear.max_probe_count;- In
Type.c:68:
MapPolicy(&map).first_index == MapPolicyLinear.first_index &&
MapPolicy(&map).next_index == MapPolicyLinear.next_index &&
MapPolicy(&map).max_probe_count == MapPolicyLinear.max_probe_count;
MapDeinit(&map);- In
Type.c:91:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy custom_policy = {
.name = "custom-linear",
.should_rehash = custom_should_rehash_snapshot,- In
Type.c:108:
custom_policy.max_probe_count = 0;
bool result = ZstrCompare(MapPolicy(&map).name, "custom-linear") == 0 &&
MapPolicy(&map).should_rehash == custom_should_rehash_snapshot &&
MapPolicy(&map).next_capacity == custom_next_capacity &&- In
Type.c:109:
bool result = ZstrCompare(MapPolicy(&map).name, "custom-linear") == 0 &&
MapPolicy(&map).should_rehash == custom_should_rehash_snapshot &&
MapPolicy(&map).next_capacity == custom_next_capacity &&
MapPolicy(&map).first_index == custom_first_index &&- In
Type.c:110:
bool result = ZstrCompare(MapPolicy(&map).name, "custom-linear") == 0 &&
MapPolicy(&map).should_rehash == custom_should_rehash_snapshot &&
MapPolicy(&map).next_capacity == custom_next_capacity &&
MapPolicy(&map).first_index == custom_first_index &&
MapPolicy(&map).next_index == custom_next_index && MapPolicy(&map).max_probe_count == 11;- In
Type.c:111:
MapPolicy(&map).should_rehash == custom_should_rehash_snapshot &&
MapPolicy(&map).next_capacity == custom_next_capacity &&
MapPolicy(&map).first_index == custom_first_index &&
MapPolicy(&map).next_index == custom_next_index && MapPolicy(&map).max_probe_count == 11;- In
Type.c:112:
MapPolicy(&map).next_capacity == custom_next_capacity &&
MapPolicy(&map).first_index == custom_first_index &&
MapPolicy(&map).next_index == custom_next_index && MapPolicy(&map).max_probe_count == 11;
MapDeinit(&map);- In
Type.c:120:
static bool test_validate_map_policy(void) {
MapPolicy custom_policy = {
.name = "custom-linear",
.should_rehash = custom_should_rehash_snapshot,- In
Type.c:137:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy custom_policy = {
.name = "vcmp-policy",
.should_rehash = custom_should_rehash_snapshot,- In
Type.c:148:
bool result = MapKeyHash(&map) == i32_hash && MapKeyCompare(&map) == i32_compare &&
MapValueCompare(&map) == i32_compare && ZstrCompare(MapPolicy(&map).name, "vcmp-policy") == 0 &&
MapPolicy(&map).should_rehash == custom_should_rehash_snapshot &&
MapPolicy(&map).next_capacity == custom_next_capacity &&- In
Type.c:149:
bool result = MapKeyHash(&map) == i32_hash && MapKeyCompare(&map) == i32_compare &&
MapValueCompare(&map) == i32_compare && ZstrCompare(MapPolicy(&map).name, "vcmp-policy") == 0 &&
MapPolicy(&map).should_rehash == custom_should_rehash_snapshot &&
MapPolicy(&map).next_capacity == custom_next_capacity &&
MapPolicy(&map).first_index == custom_first_index &&- In
Type.c:150:
MapValueCompare(&map) == i32_compare && ZstrCompare(MapPolicy(&map).name, "vcmp-policy") == 0 &&
MapPolicy(&map).should_rehash == custom_should_rehash_snapshot &&
MapPolicy(&map).next_capacity == custom_next_capacity &&
MapPolicy(&map).first_index == custom_first_index &&
MapPolicy(&map).next_index == custom_next_index && MapPolicy(&map).max_probe_count == 13;- In
Type.c:151:
MapPolicy(&map).should_rehash == custom_should_rehash_snapshot &&
MapPolicy(&map).next_capacity == custom_next_capacity &&
MapPolicy(&map).first_index == custom_first_index &&
MapPolicy(&map).next_index == custom_next_index && MapPolicy(&map).max_probe_count == 13;- In
Type.c:152:
MapPolicy(&map).next_capacity == custom_next_capacity &&
MapPolicy(&map).first_index == custom_first_index &&
MapPolicy(&map).next_index == custom_next_index && MapPolicy(&map).max_probe_count == 13;
MapDeinit(&map);- In
Deadend.c:101:
// (`>= 1`) enters the check and LOG_FATALs.
static bool test_validate_policy_skips_stuck_check_at_probe_budget_one(void) {
MapPolicy policy = {
.name = "stuck-budget-one",
.should_rehash = load_rehash,- In
Deadend.c:252:
// Returns a baseline policy that passes validate_map_policy in full.
static MapPolicy valid_baseline_policy(void) {
MapPolicy policy = {
.name = "baseline",- In
Deadend.c:253:
// Returns a baseline policy that passes validate_map_policy in full.
static MapPolicy valid_baseline_policy(void) {
MapPolicy policy = {
.name = "baseline",
.should_rehash = valid_should_rehash,- In
Deadend.c:278:
WriteFmt("Testing ValidateMapPolicy without name\n");
MapPolicy policy = valid_baseline_policy();
policy.name = "";- In
Deadend.c:289:
WriteFmt("Testing ValidateMapPolicy without should_rehash\n");
MapPolicy policy = valid_baseline_policy();
policy.should_rehash = NULL;- In
Deadend.c:300:
WriteFmt("Testing ValidateMapPolicy without next_capacity\n");
MapPolicy policy = valid_baseline_policy();
policy.next_capacity = NULL;- In
Deadend.c:311:
WriteFmt("Testing ValidateMapPolicy without first_index\n");
MapPolicy policy = valid_baseline_policy();
policy.first_index = NULL;- In
Deadend.c:322:
WriteFmt("Testing ValidateMapPolicy without next_index\n");
MapPolicy policy = valid_baseline_policy();
policy.next_index = NULL;- In
Deadend.c:333:
WriteFmt("Testing ValidateMapPolicy without probe limit\n");
MapPolicy policy = valid_baseline_policy();
policy.max_probe_count = 0;- In
Deadend.c:353:
WriteFmt("Testing ValidateMapPolicy zero-capacity for non-empty snapshot\n");
MapPolicy policy = valid_baseline_policy();
policy.next_capacity = zero_for_first_nonempty_snapshot;- In
Deadend.c:373:
WriteFmt("Testing ValidateMapPolicy capacity smaller than length\n");
MapPolicy policy = valid_baseline_policy();
policy.next_capacity = small_for_same_min;- In
Deadend.c:392:
WriteFmt("Testing ValidateMapPolicy capacity smaller than min_entries\n");
MapPolicy policy = valid_baseline_policy();
policy.next_capacity = small_for_more_min;- In
Deadend.c:409:
WriteFmt("Testing ValidateMapPolicy first_index out of range\n");
MapPolicy policy = valid_baseline_policy();
policy.first_index = out_of_range_first_index;- In
Deadend.c:429:
WriteFmt("Testing ValidateMapPolicy next_index out of range\n");
MapPolicy policy = valid_baseline_policy();
policy.next_index = out_of_range_next_index;- In
Deadend.c:448:
WriteFmt("Testing ValidateMapPolicy stuck probe sequence\n");
MapPolicy policy = valid_baseline_policy();
policy.next_index = stuck_next_index;- In
Deadend.c:465:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = valid_baseline_policy();
policy.max_probe_count = 0; // single broken field
- In
Deadend.c:602:
}
static MapPolicy make_probe_policy(MapPolicyNextIndexFn next_index) {
MapPolicy p = {
.name = "self-check-probe",- In
Deadend.c:603:
static MapPolicy make_probe_policy(MapPolicyNextIndexFn next_index) {
MapPolicy p = {
.name = "self-check-probe",
.should_rehash = poly_should_rehash,- In
Deadend.c:624:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = {
.name = "trap-at-42",
.should_rehash = poly_should_rehash,- In
Deadend.c:652:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
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);- In
Deadend.c:662:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
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);- In
Deadend.c:672:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = make_probe_policy(poly_next_index_returns_first);
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc); // must LOG_FATAL
MapDeinit(&map);- In
Access.c:84:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = {
.name = "wide-linear",
.should_rehash = never_rehash,- In
Access.c:116:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = {
.name = "shrinkable",
.should_rehash = never_rehash,- In
Access.c:387:
// never revisit -- so a quadratic-degraded-to-linear mutant makes some key
// unreachable or returns a neighbour's value here.
static bool run_collision_contract_cycle(MapPolicy policy) {
enum {
KEY_COUNT = 24
Last updated on