From: Junio C Hamano Date: Fri, 21 May 2010 11:02:16 +0000 (-0700) Subject: Merge branch 'np/malloc-threading' X-Git-Tag: v1.7.2-rc0~127 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ea5f75a64ae52590b06713d45d84de03ca109ccc;p=git.git Merge branch 'np/malloc-threading' * np/malloc-threading: Thread-safe xmalloc and xrealloc needs a recursive mutex Make xmalloc and xrealloc thread-safe --- ea5f75a64ae52590b06713d45d84de03ca109ccc diff --cc builtin/grep.c index 8e928e217,52137f4ae..b194ea3ce --- 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 6e2597728,1c171db8b..001e5db4b --- 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);