OSDN Git Service

Merge branch 'np/malloc-threading' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 16 Jun 2010 23:21:06 +0000 (16:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Jun 2010 23:21:06 +0000 (16:21 -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

diff --cc builtin/grep.c
  #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
@@@ -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);