]> granicus.if.org Git - graphviz/commitdiff
dotgen applyPacking2: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 14 Sep 2022 01:24:25 +0000 (18:24 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 14 Sep 2022 01:39:19 +0000 (18:39 -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/dotgen/aspect.c

index 8b7440f31cb055cb9fc0ee3c8d16f7bab1110ebc..7457a7e2b72d60d6169ca9e51724de78d3b6d78c 100644 (file)
@@ -430,7 +430,7 @@ static void applyPacking2(graph_t * g)
 {
     int i;
 
-    sortedLayerIndex = N_NEW(agnnodes(g), int);
+    sortedLayerIndex = gv_calloc(agnnodes(g), sizeof(int));
 
     for (i = 0; i < agnnodes(g); i++) {
        sortedLayerIndex[i] = i;