Have set_try_to_free_routine return the previous routine

This effectively requires from the callers of set_try_to_free_routine to
treat the try-to-free-routines as a stack.

We will need this for the next patch where the only current caller cannot
depend on that the previously set routine was the default routine.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Sixt
2010-05-08 17:13:49 +02:00
committed by Junio C Hamano
parent 9374919442
commit 851c34b04e
3 changed files with 10 additions and 5 deletions

View File

@ -346,7 +346,8 @@ static inline char *gitstrchrnul(const char *s, int c)
extern void release_pack_memory(size_t, int);
extern void set_try_to_free_routine(void (*routine)(size_t));
typedef void (*try_to_free_t)(size_t);
extern try_to_free_t set_try_to_free_routine(try_to_free_t);
extern char *xstrdup(const char *str);
extern void *xmalloc(size_t size);