MapInit
Description
Initialize a map with required key hash and compare callbacks plus a user-owned allocator. Uses linear probing. Allocator argument is optional inside a Scope block.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Map.Insert.c:24:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapInsertR(&map, 1, 10);- In
Map.Insert.c:70:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
int key = 42;
int value = 84;- In
Map.Insert.c:93:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
bool result = true;- In
Map.Insert.c:120:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
int *value_ptr;
bool result; DefaultAllocator alloc = DefaultAllocatorInit();
Map(Float, u64) counts = MapInit(float_hash, float_compare, &alloc);
Float k1 = FloatFromStr("3.14", &alloc.base);- In
Map.Foreach.c:24:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
int key_sum = 0;
int value_sum = 0;- In
Map.Foreach.c:48:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
int unique_key_sum = 0;
int all_value_sum = 0;- In
Map.Deadend.c:36:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapContainsPair(&map, 1, 10);- In
Map.Deadend.c:50:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapRemovePair(&map, 1, 10);- In
Map.Deadend.c:64:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapRemoveIf(&map, NULL, NULL);- In
Map.Deadend.c:78:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapRetainIf(&map, NULL, NULL);- In
Map.Remove.c:24:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapSetOnlyR(&map, 1, 10);- In
Map.Remove.c:70:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapInsertR(&map, 1, 10);- In
Map.Remove.c:92:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapInsertR(&map, 5, 50);- In
Map.Remove.c:113:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
for (int i = 0; i < 12; i++) { DefaultAllocator alloc = DefaultAllocatorInit();
Map(Int, u64) counts = MapInit(int_hash, int_compare, &alloc);
Int k1 = IntFrom(100u, &alloc.base);- In
Map.Access.c:49:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapSetOnlyR(&map, 11, 110);- In
Map.Access.c:66:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapSetOnlyR(&map, 11, 110);- In
Map.Access.c:83:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapSetOnlyR(&map, 11, 110);- In
Map.Access.c:102:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapValueCursor cursor = MapValueCursorInvalid();
int value_sum = 0;- In
Map.Access.c:138:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
MapValueCursor cursor = MapValueCursorInvalid();- In
Map.Init.c:56:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
size reserved_capacity;- In
Map.Init.c:83:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
for (int i = 0; i < 24; i++) {
IntGraph graph = GraphInit(&alloc);
CountMap counts = MapInit(node_id_hash, node_id_compare, &alloc);
GraphNodeId a = GraphAddNodeR(&graph, 1); Allocator *base = ALLOCATOR_OF(&alloc);
Map(BitVec, u64) counts = MapInit(bitvec_hash, bitvec_compare, &alloc);
BitVec k1 = BitVecInit(base);- In
Map.Ops.c:159:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
int threshold = 30;- In
Map.Type.c:58:
typedef Map(int, int) IntIntMap;
DefaultAllocator alloc = DefaultAllocatorInit();
IntIntMap map = MapInit(i32_hash, i32_compare, &alloc);
bool result = MapPairCount(&map) == 0 && MapCapacity(&map) == 0 && MapTombstones(&map) == 0 &&
Last updated on