MapMustReserve
Description
Aborting variant of MapReserve. Calls LOG_FATAL on allocation failure.
Success
Returns to the caller.
Failure
Does not return - aborts via LOG_FATAL / Abort.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Memory.h:76:
do { \
if (!MapReserve((m), (n))) { \
LOG_FATAL("MapMustReserve failed"); \
} \
} while (0)- In
Map.Init.c:191:
MapInsertR(&map, 1, 10);
MapInsertR(&map, 2, 20);
MapMustReserve(&map, 48);
bool result = (MapCapacity(&map) >= 48) && (MapPairCount(&map) == 2);
Last updated on