Skip to content
MapMustReserve

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)
        do {                                                                                                               \
            if (!MapReserve((m), (n))) {                                                                                   \
                LOG_FATAL("MapMustReserve failed");                                                                        \
            }                                                                                                              \
        } while (0)
        MapInsertR(&map, 1, 10);
        MapInsertR(&map, 2, 20);
        MapMustReserve(&map, 48);
    
        bool result = (MapCapacity(&map) >= 48) && (MapPairCount(&map) == 2);
Last updated on