gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3640 - GNUnet/src/util/string


From: durner
Subject: [GNUnet-SVN] r3640 - GNUnet/src/util/string
Date: Sat, 4 Nov 2006 08:06:08 -0800 (PST)

Author: durner
Date: 2006-11-04 08:06:04 -0800 (Sat, 04 Nov 2006)
New Revision: 3640

Modified:
   GNUnet/src/util/string/xmalloc.c
Log:
switch to use dlmalloc

Modified: GNUnet/src/util/string/xmalloc.c
===================================================================
--- GNUnet/src/util/string/xmalloc.c    2006-11-04 14:26:52 UTC (rev 3639)
+++ GNUnet/src/util/string/xmalloc.c    2006-11-04 16:06:04 UTC (rev 3640)
@@ -29,6 +29,8 @@
 #include "platform.h"
 #include "dlmalloc.h"
 
+/* #define USE_DLMALLOC */
+
 #ifndef INT_MAX
 #define INT_MAX 0x7FFFFFFF
 #endif
@@ -73,7 +75,11 @@
                filename,
                linenumber,
                function);
+#ifdef USE_DLMALLOC
   result = dlmalloc(size);
+#else
+  result = malloc(size);
+#endif
   if (result == NULL)
     GE_DIE_STRERROR_FLF(NULL,
                        GE_IMMEDIATE | GE_USER | GE_DEVELOPER | GE_FATAL,
@@ -104,7 +110,11 @@
                 const char * filename,
                 int linenumber,
                 const char * function) {
+#ifdef USE_DLMALLOC
   ptr = dlrealloc(ptr, n);
+#else
+  ptr = realloc(ptr, n);
+#endif
 
   if (!ptr)
     GE_DIE_STRERROR_FLF(NULL,
@@ -133,7 +143,11 @@
                filename,
                linenumber,
                function);
+#ifdef USE_DLMALLOC
   dlfree(ptr);
+#else
+  free(ptr);
+#endif
 }
 
 /**





reply via email to

[Prev in Thread] Current Thread [Next in Thread]