Skip to content

MapAllocator

Description

Allocator backing the map’s storage.

Parameters

Name Direction Description
m in Map.

Usage example (Cross-references)

Usage examples (Cross-references)
    
        // Report leaks for anything still in `live`.
        if (MapAllocator(&self->live) && MapPairCount(&self->live) > 0) {
            LOG_ERROR("DebugAllocator: {} live allocation(s) at deinit time:", (u64)MapPairCount(&self->live));
            MapForeachPairPtr(&self->live, key_ptr, val_ptr) {
        char c;
        while (StrIterPeek(&si, &c)) {
            Str     key   = StrInit(MapAllocator(cfg));
            Str     value = StrInit(MapAllocator(cfg));
            StrIter read_si;
        while (StrIterPeek(&si, &c)) {
            Str     key   = StrInit(MapAllocator(cfg));
            Str     value = StrInit(MapAllocator(cfg));
            StrIter read_si;
        }
    
        lookup = StrInitFromCstr(key, ZstrLen(key), MapAllocator(cfg));
        value  = kvconfig_get_ptr_str(cfg, &lookup);
        StrDeinit(&lookup);
    
        if (!value) {
            return StrInit(MapAllocator(cfg));
        }
        }
    
        return StrInitFromCstr(StrBegin(value), StrLen(value), MapAllocator(cfg));
    }
    
        if (!value) {
            return StrInit(MapAllocator(cfg));
        }
        }
    
        return StrInitFromCstr(StrBegin(value), StrLen(value), MapAllocator(cfg));
    }
                      MapValueCopyInit(&map) == (GenericCopyInit)zstr_init_clone &&
                      MapValueCopyDeinit(&map) == (GenericCopyDeinit)zstr_deinit &&
                      MapAllocator(&map) == ALLOCATOR_OF(&alloc);
    
        MapDeinit(&map);
Last updated on