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.
#include <ortho/maze.h>
#include <ortho/fPQ.h>
#include <ortho/ortho.h>
+#include <cgraph/alloc.h>
#include <cgraph/exit.h>
#include <cgraph/unused.h>
#include <common/memory.h>
for (ptr = fst; ptr; ptr = N_DAD(ptr)) sz++;
rte.n = 0;
assert(sz >= 2);
- rte.segs = N_NEW(sz-2, segment); /* at most sz-2 segments */
+ rte.segs = gv_calloc(sz - 2, sizeof(segment)); /* at most sz-2 segments */
seg.prev = seg.next = 0;
ptr = prev = N_DAD(fst);