GraphNodeIdGeneration
Description
Extract the generation encoded in a node id.
Parameters
| Name | Direction | Description |
|---|---|---|
id |
in | Graph node id. |
Success
High 32-bit generation encoded in id.
Failure
Function cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Graph.c:70:
index = GraphNodeIdIndex(node_id);
generation = GraphNodeIdGeneration(node_id);
if (!generation) {- In
Graph.c:271:
if (graph_slot_is_occupied(slot) && !graph_slot_is_marked(slot) &&
(slot->generation == GraphNodeIdGeneration(neighbor_id))) {
idx += 1;
} else {- In
Graph.c:636:
index = GraphNodeIdIndex(node_id);
generation = GraphNodeIdGeneration(node_id);
if (!generation || ((u64)index >= VecLen(&graph->slots))) {- In
Ops.c:71:
result = result && (GraphNodeIdIndex(d) == GraphNodeIdIndex(b));
result = result && (GraphNodeIdGeneration(d) == (GraphNodeIdGeneration(b) + 1));
result = result && (GraphNodeData(&graph, GraphGetNode(&graph, d)) == 40);
result = result && !GraphNodeVisited(GraphGetNode(&graph, d));- In
Ops.c:303:
result = result && (GraphNodeIdIndex(reused) == GraphNodeIdIndex(b));
result = result && (GraphNodeIdGeneration(reused) == (GraphNodeIdGeneration(b) + 1));
result = result && (counts[GraphNodeIdIndex(reused)] == 29);- In
Init.c:32:
u64 slot_count = VecLen(&graph.slots);
size slot_capacity = VecCapacity(&graph.slots);
u32 first_generation = GraphNodeIdGeneration(first_id);
u32 second_generation = GraphNodeIdGeneration(second_id);
u32 third_generation = GraphNodeIdGeneration(third_id);- In
Init.c:33:
size slot_capacity = VecCapacity(&graph.slots);
u32 first_generation = GraphNodeIdGeneration(first_id);
u32 second_generation = GraphNodeIdGeneration(second_id);
u32 third_generation = GraphNodeIdGeneration(third_id);
u64 slot_index;- In
Init.c:34:
u32 first_generation = GraphNodeIdGeneration(first_id);
u32 second_generation = GraphNodeIdGeneration(second_id);
u32 third_generation = GraphNodeIdGeneration(third_id);
u64 slot_index;- In
Insert.c:44:
GraphNodeId id1 = GraphAddNodeR(&graph, shared);
bool result = GraphNodeIdIndex(id0) == 0 && GraphNodeIdGeneration(id0) == 1 && GraphNodeIdIndex(id1) == 1;
result = result && owned == 0 && shared == 7;
result = result && GraphNodeAt(&graph, id0) == 42;- In
Type.c:53:
bool result = GraphAllocator(&graph)->alignment == 32 && GraphNodeIdIndex(node_id) == 0 &&
GraphNodeIdGeneration(node_id) == 1;
result = result && GraphNodeGetId(node) == node_id;
result = result && GraphNodeIndex(node) == 0;- In
Access.c:211:
// generation. Real code: slot is unoccupied => not contained. Mutant:
// occupancy term forced truthy + generation matches => wrongly contained.
GraphNodeId free_slot_id = make_raw_node_id(GraphNodeIdIndex(a), GraphNodeIdGeneration(a) + 1);
result = result && !GraphContainsNode(&graph, free_slot_id);- In
Access.c:355:
// id with that exact generation: index in bounds, generation nonzero and
// matching, slot unoccupied -> only the occupancy guard rejects it.
GraphNodeId free_match = make_raw_node_id(GraphNodeIdIndex(a), GraphNodeIdGeneration(a) + 1);
(void)GraphGetNode(&graph, free_match);
Last updated on