]> granicus.if.org Git - graphviz/commitdiff
Revert "Revert "Merge branch 'Grimler/graphviz-malloc.h-problem'""
authorJohn Ellson <ellson@research.att.com>
Tue, 7 Apr 2020 22:23:34 +0000 (18:23 -0400)
committerJohn Ellson <ellson@research.att.com>
Tue, 7 Apr 2020 22:23:34 +0000 (18:23 -0400)
This reverts commit 27592b90bfae96b68e8b52639be2bd827116bf92.

lib/cgraph/Makefile.am
lib/cgraph/include/malloc.h [moved from lib/cgraph/malloc.h with 100% similarity]
lib/sfdpgen/PriorityQueue.c

index bb6147b916c12d4873f9e3bf9aba55b2e25904e6..419940a7c349563c49052900e4014fd39aa6f79c 100644 (file)
@@ -8,10 +8,11 @@ pkgconfigdir = $(libdir)/pkgconfig
 
 AM_CPPFLAGS = \
        -I$(top_srcdir) \
-       -I$(top_srcdir)/lib/cdt
+       -I$(top_srcdir)/lib/cdt \
+       -Iinclude
 
 pkginclude_HEADERS = cgraph.h
-noinst_HEADERS = agxbuf.h cghdr.h malloc.h
+noinst_HEADERS = agxbuf.h cghdr.h include/malloc.h
 noinst_LTLIBRARIES = libcgraph_C.la
 lib_LTLIBRARIES = libcgraph.la
 pkgconfig_DATA = libcgraph.pc
index cc48038261b815010322f49d1808f7cacc9d5b4f..1c4c7072f5b3510ae9f480f68407c2c89cbdda10 100644 (file)
@@ -11,6 +11,8 @@
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
+#include <malloc.h>
+
 #include "LinkedList.h"
 #include "PriorityQueue.h"
 #include "memory.h"
 #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;
@@ -50,15 +46,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);
   }
 }