From: Matthew Fernandez Date: Fri, 7 Oct 2022 02:36:26 +0000 (-0700) Subject: neatogen relative_position_constraints_new: use cgraph wrapper for allocation X-Git-Tag: 6.0.2~6^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19273710a60f5187ecb742d18b0864191a26321f;p=graphviz neatogen relative_position_constraints_new: use cgraph wrapper for allocation The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h wrappers except (1) they are header-only and (2) they live in a directory (cgraph) that is at the root of the dependency tree. The long term plan is to replace all use of lib/common/memory.h with lib/cgraph/alloc.h. --- diff --git a/lib/neatogen/overlap.c b/lib/neatogen/overlap.c index 2c5cea660..015449874 100644 --- a/lib/neatogen/overlap.c +++ b/lib/neatogen/overlap.c @@ -267,9 +267,8 @@ static void relative_position_constraints_delete(void *d){ } static relative_position_constraints relative_position_constraints_new(SparseMatrix A_constr, int edge_labeling_scheme, int n_constr_nodes, int *constr_nodes){ - relative_position_constraints data; assert(A_constr); - data = MALLOC(sizeof(struct relative_position_constraints_struct)); + relative_position_constraints data = gv_alloc(sizeof(struct relative_position_constraints_struct)); data->constr_penalty = 1; data->edge_labeling_scheme = edge_labeling_scheme; data->n_constr_nodes = n_constr_nodes;