Merge branch 'np/malloc-threading'
authorJunio C Hamano <gitster@pobox.com>
Fri, 21 May 2010 11:02:16 +0000 (04:02 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 May 2010 11:02:16 +0000 (04:02 -0700)
* np/malloc-threading:
  Thread-safe xmalloc and xrealloc needs a recursive mutex
  Make xmalloc and xrealloc thread-safe

1  2 
builtin/grep.c
builtin/pack-objects.c
git-compat-util.h
wrapper.c

diff --cc builtin/grep.c
index 8e928e217041a159f4a962f0883d740aa84536d7,52137f4ae4f4fa1f3dd90a43ca88d233cb3b5d41..b194ea3cea531f3a6c81d6d27b5b3028641ba9ce
  #include "userdiff.h"
  #include "grep.h"
  #include "quote.h"
 +#include "dir.h"
  
  #ifndef NO_PTHREADS
- #include "thread-utils.h"
  #include <pthread.h>
+ #include "thread-utils.h"
  #endif
  
  static char const * const grep_usage[] = {
Simple merge
index 6e259772895599b35d13564e62077b882f0de3a6,1c171db8b1fb46c5230280b0ebd872c8f23cf7c0..001e5db4bbfb55c954168dd9b35cf3861b7a0c29
@@@ -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);
diff --cc wrapper.c
Simple merge