summaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2005-02-03 07:25:10 +0000
committerPeter Palfrader <peter@palfrader.org>2005-02-03 07:25:10 +0000
commitddd724ef94cbd77564ecba6662147eff99dd7dc1 (patch)
tree340fa84af0ef540fcd6fe5c9e56db1fa20dbf249 /src/common/util.h
parentdfa3a0220f5c4fd03c9f26b6303bf10ee578404f (diff)
downloadtor-ddd724ef94cbd77564ecba6662147eff99dd7dc1.tar.gz
tor-ddd724ef94cbd77564ecba6662147eff99dd7dc1.zip
Add --with-dmalloc configure option
svn:r3508
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/common/util.h b/src/common/util.h
index 691c05e40f..2f139515af 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -47,13 +47,19 @@
#endif
/* Memory management */
-void *tor_malloc(size_t size);
-void *tor_malloc_zero(size_t size);
-void *tor_realloc(void *ptr, size_t size);
-char *tor_strdup(const char *s);
-char *tor_strndup(const char *s, size_t n);
+void *_tor_malloc(const char *file, const int line, size_t size);
+void *_tor_malloc_zero(const char *file, const int line, size_t size);
+void *_tor_realloc(const char *file, const int line, void *ptr, size_t size);
+char *_tor_strdup(const char *file, const int line, const char *s);
+char *_tor_strndup(const char *file, const int line, const char *s, size_t n);
#define tor_free(p) do { if (p) {free(p); (p)=NULL;} } while (0)
+#define tor_malloc(size) _tor_malloc(_SHORT_FILE_, __LINE__, size)
+#define tor_malloc_zero(size) _tor_malloc_zero(_SHORT_FILE_, __LINE__, size)
+#define tor_realloc(ptr, size) _tor_realloc(_SHORT_FILE_, __LINE__, ptr, size)
+#define tor_strdup(s) _tor_strdup(_SHORT_FILE_, __LINE__, s)
+#define tor_strndup(s, n) _tor_strndup(_SHORT_FILE_, __LINE__, s, n)
+
/* String manipulation */
#define HEX_CHARACTERS "0123456789ABCDEFabcdef"
void tor_strlower(char *s);