From: Junio C Hamano Date: Tue, 8 Aug 2006 19:23:47 +0000 (-0700) Subject: debugging: XMALLOC_POISON X-Git-Tag: v1.4.2-rc4~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=aa5481c1af08edbca821a0d025d26e9bc41a5c49;p=git.git debugging: XMALLOC_POISON Compile with -DXMALLOC_POISON=1 to catch errors from using uninitialized memory returned by xmalloc. Signed-off-by: Junio C Hamano --- diff --git a/git-compat-util.h b/git-compat-util.h index 93f558056..3bcf5b13f 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -91,6 +91,9 @@ static inline void *xmalloc(size_t size) ret = malloc(1); if (!ret) die("Out of memory, malloc failed"); +#ifdef XMALLOC_POISON + memset(ret, 0xA5, size); +#endif return ret; }