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.
assert(m == n);
- if (!(*dist0)) *dist0 = MALLOC(sizeof(double)*n*n);
+ if (!(*dist0)) *dist0 = gv_calloc(n * n, sizeof(double));
for (i = 0; i < n*n; i++) (*dist0)[i] = -1;
if (!weighted){
}
}
} else {
- list = MALLOC(sizeof(int)*n);
+ list = gv_calloc(n, sizeof(int));
for (k = 0; k < n; k++){
dist = &((*dist0)[k*n]);
flag = Dijkstra(D, k, dist, &nlist, list, &dmax);