static void vec_delete(vec* pvec)
{
- for (size_t i = 0; i < vec_length(pvec); ++i) {
- vec_delete(vec_get(pvec, i));
- }
free(pvec->_mem);
free(pvec);
}
+// cycles is assumed to be a vec of vec of nodes.
+static void cycles_delete(vec* cycles) {
+ for (size_t i = 0; i < vec_length(cycles); ++i) {
+ vec_delete(vec_get(cycles, i));
+ }
+ vec_delete(cycles);
+}
+
static void vec_push_back(vec* pvec, void* data)
{
if (pvec->_elems == pvec->_capelems) {
}
}
+// Returns a vec of vec of nodes (aka a vector of cycles), which must be freed using cycles_delete.
static vec* find_all_cycles(graph_t *g)
{
node_t *n;
dfs(g, n, cycle, n, cycles);
}
- vec_delete(alloced_cycles); //cycles contains copied vecs
+ cycles_delete(alloced_cycles); //cycles contains copied vecs
return cycles;
}
if (cycle == NULL) {
if (cycles != NULL)
- vec_delete(cycles);
+ cycles_delete(cycles);
return get_centroid(g);
}
}
if (cycles != NULL)
- vec_delete(cycles);
+ cycles_delete(cycles);
sum.x /= cnt;
sum.y /= cnt;
assert "-o <ofile> - write output to <ofile>; stdout by default" in stderr, \
"truncated or malformed GVPR usage information"
-@pytest.mark.xfail() # FIXME
def test_2225():
"""
sfdp should not segfault with curved splines