MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / with_capacity

Method with_capacity

atomic-core/src/output/alive/graph.rs:136–142  ·  view source on GitHub ↗

Create a graph with pre-allocated capacity. # Arguments `vertex_capacity` - Expected number of vertices `children_capacity` - Expected total number of child entries # Example ```rust use atomic_core::output::alive::AliveGraph; // Pre-allocate for a file with ~100 vertices let graph = AliveGraph::with_capacity(100, 200); ```

(vertex_capacity: usize, children_capacity: usize)

Source from the content-addressed store, hash-verified

134 /// let graph = AliveGraph::with_capacity(100, 200);
135 /// ```
136 pub fn with_capacity(vertex_capacity: usize, children_capacity: usize) -> Self {
137 Self {
138 vertices: Vec::with_capacity(vertex_capacity),
139 children: Vec::with_capacity(children_capacity),
140 total_bytes: 0,
141 }
142 }
143
144 /// Get the number of vertices in the graph.
145 ///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected