MapMustInsertR
Description
Aborting variant of MapInsertR. See that macro for parameter semantics and success-state effects.
Success
Returns to the caller. The underlying MapInsertR call succeeded; see MapInsertR for the post-state.
Failure
Does not return - aborts via LOG_FATAL / Abort when the underlying MapInsertR call returns false.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Insert.h:488:
do { \
if (!MapInsertR((m), (in_key), (in_value))) { \
LOG_FATAL("MapMustInsertR failed"); \
} \
} while (0)- In
Map.Init.c:259:
};
for (int i = 0; i < N; i++)
MapMustInsertR(&map, i, i * 7 + 1);
bool result = (MapPairCount(&map) == N);- In
Map.Insert.c:660:
result = result && (MapValueCountForKey(&map, 1) == 1);
MapMustInsertR(&map, 2, 20);
result = result && (MapValueCountForKey(&map, 2) == 1);- In
Map.Remove.c:382:
// Four keys colliding into one bucket form a single probe chain.
for (int k = 0; k < 4; k++)
MapMustInsertR(&map, k, k * 10);
// Remove two interior keys; the ones before and after must stay reachable.
Last updated on