From: Matthew Fernandez Date: Sat, 10 Sep 2022 03:07:41 +0000 (-0700) Subject: sfdpgen Multilevel_control_new: use cgraph wrapper for allocation X-Git-Tag: 6.0.2~44^2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6eea83a917408e6f3bd7acf4a2352ca838cf289;p=graphviz sfdpgen Multilevel_control_new: use cgraph wrapper 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/sfdpgen/Multilevel.c b/lib/sfdpgen/Multilevel.c index d6f5bb374..c03310f02 100644 --- a/lib/sfdpgen/Multilevel.c +++ b/lib/sfdpgen/Multilevel.c @@ -12,14 +12,13 @@ #include #include #include +#include #include #include #include Multilevel_control Multilevel_control_new(void) { - Multilevel_control ctrl; - - ctrl = GNEW(struct Multilevel_control_struct); + Multilevel_control ctrl = gv_alloc(sizeof(struct Multilevel_control_struct)); ctrl->minsize = 4; ctrl->min_coarsen_factor = 0.75; ctrl->maxlevel = 1<<30;