summaryrefslogtreecommitdiff
path: root/trace.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-21 09:24:18 -0800
committerJunio C Hamano <gitster@pobox.com>2010-12-21 09:25:14 -0800
commit00b0d7f77b65ed2d059f893bbd2011ba5bb4252d (patch)
treefe34aef50ca3aba79424e5e6f13f6e853135d778 /trace.c
parent6068ac88488f01400eae5c063d8e4a08e9d87f74 (diff)
downloadgit-00b0d7f77b65ed2d059f893bbd2011ba5bb4252d.tar.gz
set_try_to_free_routine(NULL) means "do nothing special"
This way, the next caller that wants to disable our memory reclamation machinery does not have to define its own do_nothing() stub. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace.c')
-rw-r--r--trace.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/trace.c b/trace.c
index 62586fa371..0fb2a2c64b 100644
--- a/trace.c
+++ b/trace.c
@@ -25,10 +25,6 @@
#include "cache.h"
#include "quote.h"
-static void do_nothing(size_t unused)
-{
-}
-
/* Get a trace file descriptor from GIT_TRACE env variable. */
static int get_trace_fd(int *need_close)
{
@@ -76,7 +72,7 @@ void trace_printf(const char *fmt, ...)
if (!fd)
return;
- set_try_to_free_routine(do_nothing); /* is never reset */
+ set_try_to_free_routine(NULL); /* is never reset */
strbuf_init(&buf, 64);
va_start(ap, fmt);
len = vsnprintf(buf.buf, strbuf_avail(&buf), fmt, ap);
@@ -108,7 +104,7 @@ void trace_argv_printf(const char **argv, const char *fmt, ...)
if (!fd)
return;
- set_try_to_free_routine(do_nothing); /* is never reset */
+ set_try_to_free_routine(NULL); /* is never reset */
strbuf_init(&buf, 64);
va_start(ap, fmt);
len = vsnprintf(buf.buf, strbuf_avail(&buf), fmt, ap);