]> granicus.if.org Git - graphviz/commitdiff
neatogen relative_position_constraints_new: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 7 Oct 2022 02:36:26 +0000 (19:36 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 11 Oct 2022 00:40:54 +0000 (17:40 -0700)
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.

lib/neatogen/overlap.c

index 2c5cea6607fc07c41ef9ecd2f955bf714486d51d..015449874c19fc70917f9e6ae00c5ec904e165bd 100644 (file)
@@ -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;