author | Nicolas Pitre <nico@fluxnic.net> | |
Wed, 24 Mar 2010 20:22:34 +0000 (16:22 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 24 Mar 2010 21:15:09 +0000 (14:15 -0700) | ||
commit | a9a746364bd26d333c7229c6f7e851b507cd284a | |
tree | 72116fd86230efbfdd21f0fa78e68cb8a88a2a2d | tree | snapshot |
parent | 846b8f681a0a75cec2b930007c84e98346940459 | commit | diff |
Make xmalloc and xrealloc thread-safe
By providing a hook for the routine responsible for trying to free some
memory on malloc failure, we can ensure that the called routine is
protected by the appropriate locks when threads are in play.
The obvious offender here was pack-objects which was calling xmalloc()
within threads while release_pack_memory() is not thread safe.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
By providing a hook for the routine responsible for trying to free some
memory on malloc failure, we can ensure that the called routine is
protected by the appropriate locks when threads are in play.
The obvious offender here was pack-objects which was calling xmalloc()
within threads while release_pack_memory() is not thread safe.
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-pack-objects.c | diff | blob | history | |
git-compat-util.h | diff | blob | history | |
wrapper.c | diff | blob | history |