]> granicus.if.org Git - graphviz/commitdiff
sfdpgen oned_optimizer_new: use cgraph wrapper for allocation
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 28 Aug 2022 19:54:16 +0000 (12:54 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 31 Aug 2022 00:12:49 +0000 (17:12 -0700)
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.

lib/sfdpgen/spring_electrical.c

index def6071b97766881185f2397ff820cab795537da..5bb85de256d96c2b583a18fbb1a43d84184215d3 100644 (file)
@@ -100,7 +100,7 @@ void oned_optimizer_delete(oned_optimizer opt){
 
 oned_optimizer oned_optimizer_new(int i){
   oned_optimizer opt;
-  opt = MALLOC(sizeof(struct oned_optimizer_struct));
+  opt = gv_alloc(sizeof(struct oned_optimizer_struct));
   opt->i = i;
   opt->direction = OPT_INIT;
   return opt;