]> granicus.if.org Git - graphviz/commitdiff
fdpgen adjustGrid: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 18 Nov 2022 01:14:41 +0000 (17:14 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 23 Nov 2022 04:09:31 +0000 (20:09 -0800)
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/fdpgen/grid.c

index e71780cc67bc7d639fe3d515dab8754d04db902a..b4cb7a83be37647aed086e81259753503a97b613 100644 (file)
@@ -190,7 +190,7 @@ void adjustGrid(Grid * g, int nnodes)
        nsize = MAX(nnodes, 2 * g->listSize);
        if (g->listMem)
            free(g->listMem);
-       g->listMem = N_GNEW(nsize, node_list);
+       g->listMem = gv_calloc(nsize, sizeof(node_list));
        g->listSize = nsize;
     }
 }