From: Junio C Hamano Date: Wed, 16 Jun 2010 23:21:06 +0000 (-0700) Subject: Merge branch 'np/malloc-threading' into maint X-Git-Tag: v1.7.2-rc0~63^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c1eba5e312838774afe44bb52885f3cd7e4ac7a;p=thirdparty%2Fgit.git Merge branch 'np/malloc-threading' into maint * np/malloc-threading: Thread-safe xmalloc and xrealloc needs a recursive mutex Make xmalloc and xrealloc thread-safe --- 5c1eba5e312838774afe44bb52885f3cd7e4ac7a diff --cc builtin/grep.c index 8e928e2170,52137f4ae4..b194ea3cea --- a/builtin/grep.c +++ b/builtin/grep.c @@@ -14,11 -14,10 +14,11 @@@ #include "userdiff.h" #include "grep.h" #include "quote.h" +#include "dir.h" #ifndef NO_PTHREADS - #include "thread-utils.h" #include + #include "thread-utils.h" #endif static char const * const grep_usage[] = { diff --cc git-compat-util.h index b96912b5d3,1c171db8b1..c4f4e15036 --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -346,16 -344,10 +346,18 @@@ static inline char *gitstrchrnul(const } #endif +#ifndef HAVE_MEMPCPY +#define mempcpy gitmempcpy +static inline void *gitmempcpy(void *dest, const void *src, size_t n) +{ + return (char *)memcpy(dest, src, n) + n; +} +#endif + extern void release_pack_memory(size_t, int); + extern void set_try_to_free_routine(void (*routine)(size_t)); + extern char *xstrdup(const char *str); extern void *xmalloc(size_t size); extern void *xmallocz(size_t size);