From: Matthew Fernandez Date: Sat, 3 Sep 2022 18:03:48 +0000 (-0700) Subject: ortho mkStack: use cgraph wrappers for allocation X-Git-Tag: 6.0.1~11^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3be5fa4c0e8b3b891b8332de8397bec62ab849f0;p=graphviz ortho mkStack: use cgraph wrappers for allocation 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. --- diff --git a/lib/ortho/rawgraph.c b/lib/ortho/rawgraph.c index 1e4d7c3ef..ab2f04fc7 100644 --- a/lib/ortho/rawgraph.c +++ b/lib/ortho/rawgraph.c @@ -13,7 +13,6 @@ #include "config.h" #include #include -#include #include #include @@ -78,8 +77,8 @@ typedef struct { static stack* mkStack (int i) { - stack* sp = NEW(stack); - sp->vals = N_NEW(i,int); + stack* sp = gv_alloc(sizeof(stack)); + sp->vals = gv_calloc(i, sizeof(int)); sp->top = -1; return sp; }