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_local.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/be_local.c') diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 227bc9bc..30e59d00 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -667,7 +667,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) } files = realloc(files, sizeof(alpm_file_t) * files_size); if(!files) { - 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 @@ -680,7 +680,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq) len += 1; files[files_count].name = malloc(len); if(files[files_count].name == NULL) { - ALLOC_FAIL(len); + _alpm_alloc_fail(len); goto error; } memcpy(files[files_count].name, line, len); -- cgit v1.2.3-24-g4f1b