MapInitWithPolicy
Description
Initialize a map with key callbacks and an explicit probing policy.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Init.c:119:
.max_probe_count = 32,
};
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, custom_policy, &alloc);
bool result = true;- In
Insert.c:870:
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = make_small_probe_policy();
IntIntMap map = MapInitWithPolicy(i32_identity_hash, i32_compare, policy, &alloc);
const int keys[] = {0, 8, 16, 24, 32, 40};- In
Insert.c:952:
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = fill_then_grow_policy();
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc);
bool result = true;- In
Insert.c:1033:
.max_probe_count = 4,
};
IntIntMap map = MapInitWithPolicy(id_hash, i32_compare, policy, &alloc);
const int keys[] = {0, 16, 32, 48, 64};- In
Insert.c:1060:
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = make_policy42();
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc);
MapInsertR(&map, 1, 10);- In
Insert.c:1182:
DefaultAllocator alloc = DefaultAllocatorInit();
MapPolicy policy = fill_then_grow_policy();
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc);
for (int k = 0; k < 8; k++)- In
Type.c:99:
.max_probe_count = 11,
};
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, custom_policy, &alloc);
custom_policy.name = "changed";- In
Deadend.c:461:
// would let an invalid-policy map be built silently.
static bool test_map_init_with_invalid_policy_fails(void) {
WriteFmt("Testing MapInitWithPolicy with an invalid policy\n");
typedef Map(int, int) IntIntMap;- In
Deadend.c:468:
policy.max_probe_count = 0; // single broken field
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc);
(void)map;
return false;- In
Deadend.c:632:
.max_probe_count = 8,
};
IntIntMap map = MapInitWithPolicy(i32_hash, i32_compare, policy, &alloc);
bool result = MapInsertR(&map, 1, 10);
result = result && MapGetFirstPtr(&map, 1) && (*MapGetFirstPtr(&map, 1) == 10);- In
Deadend.c:653:
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);
DefaultAllocatorDeinit(&alloc);- In
Deadend.c:663:
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);
DefaultAllocatorDeinit(&alloc);- In
Deadend.c:673:
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);
DefaultAllocatorDeinit(&alloc);- In
Access.c:92:
.max_probe_count = 100,
};
IntIntMap map = MapInitWithPolicy(const_hash, i32_compare, policy, &alloc);
MapReserve(&map, 200);- In
Access.c:124:
.max_probe_count = 32,
};
IntIntMap map = MapInitWithPolicy(const_hash, i32_compare, policy, &alloc);
MapReserve(&map, 6);
Last updated on