From 27592b90bfae96b68e8b52639be2bd827116bf92 Mon Sep 17 00:00:00 2001 From: John Ellson Date: Tue, 7 Apr 2020 03:24:00 +0000 Subject: [PATCH] Revert "Merge branch 'Grimler/graphviz-malloc.h-problem'" This reverts merge request !1332 --- lib/cgraph/Makefile.am | 5 ++--- lib/cgraph/{include => }/malloc.h | 0 lib/sfdpgen/PriorityQueue.c | 16 ++++++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) rename lib/cgraph/{include => }/malloc.h (100%) diff --git a/lib/cgraph/Makefile.am b/lib/cgraph/Makefile.am index 419940a7c..bb6147b91 100644 --- a/lib/cgraph/Makefile.am +++ b/lib/cgraph/Makefile.am @@ -8,11 +8,10 @@ pkgconfigdir = $(libdir)/pkgconfig AM_CPPFLAGS = \ -I$(top_srcdir) \ - -I$(top_srcdir)/lib/cdt \ - -Iinclude + -I$(top_srcdir)/lib/cdt pkginclude_HEADERS = cgraph.h -noinst_HEADERS = agxbuf.h cghdr.h include/malloc.h +noinst_HEADERS = agxbuf.h cghdr.h malloc.h noinst_LTLIBRARIES = libcgraph_C.la lib_LTLIBRARIES = libcgraph.la pkgconfig_DATA = libcgraph.pc diff --git a/lib/cgraph/include/malloc.h b/lib/cgraph/malloc.h similarity index 100% rename from lib/cgraph/include/malloc.h rename to lib/cgraph/malloc.h diff --git a/lib/sfdpgen/PriorityQueue.c b/lib/sfdpgen/PriorityQueue.c index 1c4c7072f..cc4803826 100644 --- a/lib/sfdpgen/PriorityQueue.c +++ b/lib/sfdpgen/PriorityQueue.c @@ -11,8 +11,6 @@ * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ -#include - #include "LinkedList.h" #include "PriorityQueue.h" #include "memory.h" @@ -20,6 +18,12 @@ #include "assert.h" #include "arith.h" +#define MALLOC gmalloc +#define REALLOC grealloc +#define FREE free +#define MEMCPY memcpy + + PriorityQueue PriorityQueue_new(int n, int ngain){ PriorityQueue q; int i; @@ -46,15 +50,15 @@ void PriorityQueue_delete(PriorityQueue q){ if (q){ if (q->buckets){ for (i = 0; i < q->ngain+1; i++) DoubleLinkedList_delete((q->buckets)[i], free); - free(q->buckets); + FREE(q->buckets); } if (q->where){ - free(q->where); + FREE(q->where); } - free(q->gain); - free(q); + FREE(q->gain); + FREE(q); } } -- 2.40.0