From 5a9f5c60dae8d173e9e2f6da78499c046600e6ca Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 29 Apr 2012 23:40:06 -0500 Subject: Convert ALLOC_FAIL macro into a function This path is rarely (read: never) taken in any normal run of the code, so injecting the fprintf() call everywhere with the macro is a bit overkill. Instead, add a lightweight _alpm_alloc_fail() function that gets called instead. This does have a reasonable effect on the size of the generated code; most places using the macros provided by util.c have their code size reduced. Signed-off-by: Dan McGee --- lib/libalpm/be_package.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libalpm/be_package.c') diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index bcb884f4..0d296a81 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -476,7 +476,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, newfiles = realloc(newpkg->files.files, sizeof(alpm_file_t) * files_size); if(!newfiles) { - ALLOC_FAIL(sizeof(alpm_file_t) * files_size); + _alpm_alloc_fail(sizeof(alpm_file_t) * files_size); goto error; } /* ensure all new memory is zeroed out, in both the initial -- cgit v1.2.3-24-g4f1b