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~7^2~46 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5c1eba5e312838774afe44bb52885f3cd7e4ac7a;p=git.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 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 b96912b5d,1c171db8b..c4f4e1503 --- 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);