summaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-10-03 20:20:38 +0000
committerNick Mathewson <nickm@torproject.org>2005-10-03 20:20:38 +0000
commitc5ee3e961ef1556ed62449211adf9db6ef5150ca (patch)
tree77bd69d9ee2fe57923ba2c83d753324c6003a389 /src/common/util.h
parent9e54e2e2931a4c86ff13b70a8a04024f83cd67a2 (diff)
downloadtor-c5ee3e961ef1556ed62449211adf9db6ef5150ca.tar.gz
tor-c5ee3e961ef1556ed62449211adf9db6ef5150ca.zip
Reorganize some quick-and-dirty code to find out what openssl stuff is leaking, using dmalloc.
svn:r5178
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/common/util.h b/src/common/util.h
index e644940b82..786a3eee9a 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -48,8 +48,8 @@
#endif
#ifdef USE_DMALLOC
-#define DMALLOC_PARAMS const char *file, const int line,
-#define DMALLOC_ARGS _SHORT_FILE_, __LINE__,
+#define DMALLOC_PARAMS , const char *file, const int line
+#define DMALLOC_ARGS , _SHORT_FILE_, __LINE__
#else
#define DMALLOC_PARAMS
#define DMALLOC_ARGS
@@ -61,11 +61,11 @@
#define tor_fragile_assert()
/* Memory management */
-void *_tor_malloc(DMALLOC_PARAMS size_t size);
-void *_tor_malloc_zero(DMALLOC_PARAMS size_t size);
-void *_tor_realloc(DMALLOC_PARAMS void *ptr, size_t size);
-char *_tor_strdup(DMALLOC_PARAMS const char *s);
-char *_tor_strndup(DMALLOC_PARAMS const char *s, size_t n);
+void *_tor_malloc(size_t size DMALLOC_PARAMS);
+void *_tor_malloc_zero(size_t size DMALLOC_PARAMS);
+void *_tor_realloc(void *ptr, size_t size DMALLOC_PARAMS);
+char *_tor_strdup(const char *s DMALLOC_PARAMS);
+char *_tor_strndup(const char *s, size_t n DMALLOC_PARAMS);
#ifdef USE_DMALLOC
extern int dmalloc_free(const char *file, const int line, void *pnt,
const int func_id);
@@ -79,11 +79,11 @@ extern int dmalloc_free(const char *file, const int line, void *pnt,
#define tor_free(p) do { if (p) {free(p); (p)=NULL;} } while (0)
#endif
-#define tor_malloc(size) _tor_malloc(DMALLOC_ARGS size)
-#define tor_malloc_zero(size) _tor_malloc_zero(DMALLOC_ARGS size)
-#define tor_realloc(ptr, size) _tor_realloc(DMALLOC_ARGS ptr, size)
-#define tor_strdup(s) _tor_strdup(DMALLOC_ARGS s)
-#define tor_strndup(s, n) _tor_strndup(DMALLOC_ARGS s, n)
+#define tor_malloc(size) _tor_malloc(size DMALLOC_ARGS)
+#define tor_malloc_zero(size) _tor_malloc_zero(size DMALLOC_ARGS)
+#define tor_realloc(ptr, size) _tor_realloc(ptr, size DMALLOC_ARGS)
+#define tor_strdup(s) _tor_strdup(s DMALLOC_ARGS)
+#define tor_strndup(s, n) _tor_strndup(s, n DMALLOC_ARGS)
/* String manipulation */
#define HEX_CHARACTERS "0123456789ABCDEFabcdef"