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.
n = hierarchy->nvtxs[min_level];
// compute distances from foci nodes
- nodes = N_NEW(n, int);
- distances = N_NEW(n, double);
+ nodes = gv_calloc(n, sizeof(int));
+ distances = gv_calloc(n, sizeof(double));
for (i = 0; i < n; i++) {
nodes[i] = i;
distances[i] = dist_from_foci(graph, i, foci_nodes, num_foci);