From 64a47c01426a36cdb7e598d17018d5791e54bb97 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 30 Dec 2008 23:21:36 -0800 Subject: Wrap malloc and friends and report out of memory as GIT_ENOMEM We now forbid direct use of malloc, strdup or calloc within the library and instead use wrapper functions git__malloc, etc. to invoke the underlying library malloc and set git_errno to a no memory error code if the allocation fails. In the future once we have pack objects in memory we are likely to enhance these routines with garbage collection logic to purge cached pack data when allocations fail. Because the size of the function will grow somewhat large, we don't want to mark them for inline as gcc tends to aggressively inline, creating larger than expected executables. Signed-off-by: Shawn O. Pearce --- src/commit.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/commit.c') diff --git a/src/commit.c b/src/commit.c index ce02d0ef9..710a14e92 100644 --- a/src/commit.c +++ b/src/commit.c @@ -23,6 +23,7 @@ * Boston, MA 02110-1301, USA. */ +#include "common.h" #include "commit.h" const git_oid *git_commit_id(git_commit *c) -- cgit v1.2.1