summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8c67c39)
raw | patch | inline | side by side (parent: 8c67c39)
author | Matthieu Moy <Matthieu.Moy@imag.fr> | |
Fri, 20 Aug 2010 15:09:51 +0000 (17:09 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 20 Aug 2010 16:27:38 +0000 (09:27 -0700) |
Out-of-memory errors can either be actual lack of memory, or bugs (like
code trying to call xmalloc(-1) by mistake). A little more information
may help tracking bugs reported by users.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
code trying to call xmalloc(-1) by mistake). A little more information
may help tracking bugs reported by users.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
wrapper.c | patch | blob | history |
diff --git a/wrapper.c b/wrapper.c
index afb4f6f773a3ed909433778f4b4da3740ded2b18..fd8ead33ed72c37e690ee1fc5b8568f629c95145 100644 (file)
--- a/wrapper.c
+++ b/wrapper.c
if (!ret && !size)
ret = malloc(1);
if (!ret)
- die("Out of memory, malloc failed");
+ die("Out of memory, malloc failed (tried to allocate %lu bytes)",
+ (unsigned long)size);
}
#ifdef XMALLOC_POISON
memset(ret, 0xA5, size);