From 00b0d7f77b65ed2d059f893bbd2011ba5bb4252d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 21 Dec 2010 09:24:18 -0800 Subject: 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 --- wrapper.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'wrapper.c') diff --git a/wrapper.c b/wrapper.c index 4c1639f153..8d7dd31c4b 100644 --- a/wrapper.c +++ b/wrapper.c @@ -12,6 +12,8 @@ static void (*try_to_free_routine)(size_t size) = do_nothing; try_to_free_t set_try_to_free_routine(try_to_free_t routine) { try_to_free_t old = try_to_free_routine; + if (!routine) + routine = do_nothing; try_to_free_routine = routine; return old; } -- cgit v1.2.1