GraphDeinit
Description
Release every node, every edge list, and the backing slot storage of g. If the graph was created with a deep-copy deinit callback, that callback is invoked on each live node payload before the slot is freed.
Parameters
| Name | Direction | Description |
|---|---|---|
g |
in,out | Graph to deinitialize. Must not be used until reinitialized. |
Success
All node payloads released, all edge bookkeeping freed; g left in the zeroed post-deinit state.
Failure
Cannot fail; aborts on a corrupted magic via the validator.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Ops.c:28:
result = result && !GraphNodeVisited(node) && (GraphNodeVisitCount(node) == 0);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:75:
result = result && !GraphNodeVisited(GraphGetNode(&graph, d));
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:102:
result = result && (GraphNodeCount(&graph) == 1);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:151:
result = result && (GraphPredecessorAt(&graph, c, 0) == a);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:180:
result = result && (GraphEdgeCount(&graph) == 1);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:214:
result = result && (GraphInDegree(&graph, c) == 0);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:240:
result = result && (GraphInDegree(&graph, a) == 0);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:276:
result = result && (GraphInDegree(&graph, d) == 0);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:311:
result = result && (GraphNodeAt(&graph, reused) == 99);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:331:
(void)GraphNodeVisit(node);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Ops.c:376:
result = result && (GraphNodeCount(&graph) == 2);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:411:
result = result && (GraphNodeCount(&graph) == 1);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:445:
result = result && (GraphNodeCount(&graph) == 1);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:487:
result = result && (GraphInDegree(&graph, c) == 0);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:512:
(void)GraphEdgeMarkedForRemoval(&graph, a, b);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Ops.c:536:
(void)GraphEdgeMarkedForRemoval(&graph, a, b);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Ops.c:562:
(void)GraphUnmarkEdgeForRemoval(&graph, a, b);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Ops.c:586:
(void)GraphUnmarkEdgeForRemoval(&graph, a, b);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Ops.c:654:
GENERIC_GRAPH(&graph)->__magic &= ~MAGIC_VALIDATED_BIT;
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:705:
result = result && GraphContainsNode(&graph, c);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Ops.c:761:
result = result && GraphNodeMarkedForDeletion(GraphGetNode(&graph, c));
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:73:
result = result && (VecPtrAt(&graph.slots, GraphNodeIdIndex(third_id))->generation == (third_generation + 1));
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:98:
StrDeinit(&name);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:121:
ZstrCompare(StrBegin(stored_name), "alpha") == 0;
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:172:
result = result && (graph_h.pending_edge_removals.allocator->retry_limit == 31);
GraphDeinit(&graph_a);
GraphDeinit(&graph_b);
GraphDeinit(&graph_c);- In
Init.c:173:
GraphDeinit(&graph_a);
GraphDeinit(&graph_b);
GraphDeinit(&graph_c);
GraphDeinit(&graph_d);- In
Init.c:174:
GraphDeinit(&graph_a);
GraphDeinit(&graph_b);
GraphDeinit(&graph_c);
GraphDeinit(&graph_d);
GraphDeinit(&graph_e);- In
Init.c:175:
GraphDeinit(&graph_b);
GraphDeinit(&graph_c);
GraphDeinit(&graph_d);
GraphDeinit(&graph_e);
GraphDeinit(&graph_f);- In
Init.c:176:
GraphDeinit(&graph_c);
GraphDeinit(&graph_d);
GraphDeinit(&graph_e);
GraphDeinit(&graph_f);
GraphDeinit(&graph_g);- In
Init.c:177:
GraphDeinit(&graph_d);
GraphDeinit(&graph_e);
GraphDeinit(&graph_f);
GraphDeinit(&graph_g);
GraphDeinit(&graph_h);- In
Init.c:178:
GraphDeinit(&graph_e);
GraphDeinit(&graph_f);
GraphDeinit(&graph_g);
GraphDeinit(&graph_h);- In
Init.c:179:
GraphDeinit(&graph_f);
GraphDeinit(&graph_g);
GraphDeinit(&graph_h);
HeapAllocatorDeinit(&aligned_64);- In
Init.c:204:
result = result && (VecCapacity(&graph.slots) >= 64);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Init.c:216:
// Mark (but do not commit) an edge removal so a backing exists at teardown.
static bool test_deinit_frees_pending_edge_removals_backing_no_leak(void) {
WriteFmt("Testing GraphDeinit frees the pending-edge-removals backing (no leak)\n");
DebugAllocator dbg = DebugAllocatorInit();- In
Init.c:229:
GraphMarkEdgeForRemoval(&graph, a, b); // pending_edge_removals gains backing
GraphDeinit(&graph); // deinit_vec(pending_edge_removals) frees the array
bool ok = LEAK_CLEAN(dbg);- In
Insert.c:49:
result = result && GraphNodeAt(&graph, id1) == 7;
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:79:
result = result && GraphPredecessorAt(&graph, c, 0) == a;
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:108:
result = result && (GraphPredecessorAt(&graph, a, 2) == c);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:136:
result = result && (GraphMutationEpoch(&graph) > old_epoch);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:165:
result = result && (GraphMutationEpoch(&graph) > old_epoch);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:201:
result = result && (GraphNodeCount(&graph) == 2);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:238:
result = result && !GraphContainsNode(&graph, b);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Insert.c:278:
result = result && (GraphNodeCount(&graph) == 0);
GraphDeinit(&graph);
DebugAllocatorDeinit(&dbg);
return result;- In
Insert.c:320:
result = result && (GraphNodeCount(&graph) == 1);
GraphDeinit(&graph);
DebugAllocatorDeinit(&dbg);
return result;- In
Type.c:36:
GraphMutationEpoch(&graph) == 0 && GraphAllocator(&graph)->alignment == 1;
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Type.c:58:
result = result && GraphContainsNode(&graph, node_id);
GraphDeinit(&graph);
HeapAllocatorDeinit(&alloc);
return result;- In
Type.c:95:
result = result && (GraphNodeCount(&graph) == 3);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Type.c:129:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Type.c:255:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Type.c:287:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Type.c:321:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Type.c:353:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Type.c:386:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Type.c:416:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Type.c:448:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Type.c:481:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Type.c:514:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Type.c:551:
ValidateGraph(&graph);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Foreach.c:126:
MapDeinit(&index);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Foreach.c:166:
MapDeinit(&counts);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Foreach.c:202:
result = result && (GraphInDegree(&graph, a) == 0);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Foreach.c:223:
}
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Foreach.c:247:
}
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Foreach.c:273:
}
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Foreach.c:310:
bool result = (visited == 2);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Foreach.c:349:
result = result && (GraphNodeCount(&graph) == 2);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Foreach.c:389:
(void)graph_neighbor_iter_next(&iter, &out);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Foreach.c:422:
(void)graph_predecessor_iter_next(&iter, &out);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Foreach.c:497:
}
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Foreach.c:528:
}
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Foreach.c:559:
}
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Foreach.c:607:
bool result = (visited == 1);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:53:
result = result && GraphPredecessorAt(&graph, c, 0) == a;
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:79:
result = result && (ZstrCompare(*GraphNodePtrAt(&graph, red), "red") == 0);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:96:
(void)GraphNodeData(&graph_b, node);
GraphDeinit(&graph_b);
GraphDeinit(&graph_a);
DefaultAllocatorDeinit(&alloc);- In
Access.c:97:
GraphDeinit(&graph_b);
GraphDeinit(&graph_a);
DefaultAllocatorDeinit(&alloc);
return false;- In
Access.c:116:
(void)GraphPredecessorAt(&graph, a, 0);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Access.c:135:
(void)GraphNeighborAt(&graph, b, 0);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Access.c:178:
graph.slots.length += 1;
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:214:
result = result && !GraphContainsNode(&graph, free_slot_id);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return result;- In
Access.c:250:
(void)GraphGetNode(&graph, b);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Access.c:274:
(void)GraphGetNode(&graph, a);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Access.c:298:
(void)GraphHasEdge(&graph, a, bogus_to);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Access.c:324:
(void)GraphNodeAt(&graph, a);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;- In
Access.c:359:
(void)GraphGetNode(&graph, free_match);
GraphDeinit(&graph);
DefaultAllocatorDeinit(&alloc);
return false;
Last updated on