Skip to content
GraphAllocator

GraphAllocator

Description

Allocator backing the graph’s slots, adjacency vectors, and node payloads.

Parameters

Name Direction Description
g in Graph to query.

Usage example (Cross-references)

Usage examples (Cross-references)
                      VecBegin(&graph.pending_edge_removals) == NULL && GraphCopyInit(&graph) == NULL &&
                      GraphCopyDeinit(&graph) == NULL && graph.pending_delete_count == 0 &&
                      GraphMutationEpoch(&graph) == 0 && GraphAllocator(&graph)->alignment == 1;
    
        GraphDeinit(&graph);
        GraphNode   node    = GraphGetNode(&graph, node_id);
    
        bool result = GraphAllocator(&graph)->alignment == 32 && GraphNodeIdIndex(node_id) == 0 &&
                      GraphNodeIdGeneration(node_id) == 1;
        result = result && GraphNodeGetId(node) == node_id;
        // `slots`, `free_indices`, `pending_edge_removals` are fixture-internal reads --
        // their inner allocator pointers are not part of the public Graph surface.
        bool result = (GraphAllocator(&graph_a)->retry_limit == 31) && (GraphAllocator(&graph_b)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_c)->retry_limit == 31) && (GraphAllocator(&graph_d)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_e)->retry_limit == 31) && (GraphAllocator(&graph_f)->retry_limit == 31);
        // their inner allocator pointers are not part of the public Graph surface.
        bool result = (GraphAllocator(&graph_a)->retry_limit == 31) && (GraphAllocator(&graph_b)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_c)->retry_limit == 31) && (GraphAllocator(&graph_d)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_e)->retry_limit == 31) && (GraphAllocator(&graph_f)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_g)->retry_limit == 31) && (GraphAllocator(&graph_h)->retry_limit == 31);
        bool result = (GraphAllocator(&graph_a)->retry_limit == 31) && (GraphAllocator(&graph_b)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_c)->retry_limit == 31) && (GraphAllocator(&graph_d)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_e)->retry_limit == 31) && (GraphAllocator(&graph_f)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_g)->retry_limit == 31) && (GraphAllocator(&graph_h)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_e)->alignment == 8) && (GraphAllocator(&graph_f)->alignment == 16);
        result      = result && (GraphAllocator(&graph_c)->retry_limit == 31) && (GraphAllocator(&graph_d)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_e)->retry_limit == 31) && (GraphAllocator(&graph_f)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_g)->retry_limit == 31) && (GraphAllocator(&graph_h)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_e)->alignment == 8) && (GraphAllocator(&graph_f)->alignment == 16);
        result      = result && (GraphAllocator(&graph_g)->alignment == 32) && (GraphAllocator(&graph_h)->alignment == 64);
        result      = result && (GraphAllocator(&graph_e)->retry_limit == 31) && (GraphAllocator(&graph_f)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_g)->retry_limit == 31) && (GraphAllocator(&graph_h)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_e)->alignment == 8) && (GraphAllocator(&graph_f)->alignment == 16);
        result      = result && (GraphAllocator(&graph_g)->alignment == 32) && (GraphAllocator(&graph_h)->alignment == 64);
        result      = result && (GraphCopyInit(&graph_c) == (GenericCopyInit)str_init_copy);
        result      = result && (GraphAllocator(&graph_g)->retry_limit == 31) && (GraphAllocator(&graph_h)->retry_limit == 31);
        result      = result && (GraphAllocator(&graph_e)->alignment == 8) && (GraphAllocator(&graph_f)->alignment == 16);
        result      = result && (GraphAllocator(&graph_g)->alignment == 32) && (GraphAllocator(&graph_h)->alignment == 64);
        result      = result && (GraphCopyInit(&graph_c) == (GenericCopyInit)str_init_copy);
        result      = result && (GraphCopyDeinit(&graph_d) == (GenericCopyDeinit)str_deinit);
Last updated on