From aeff7957f2dd5ba88fb5e987cb828239b428c247 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 6 Jun 2011 17:37:42 +0000 Subject: [PATCH] Leaner implementation of macro BURN_ALLOC_MEM --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/init.c | 15 +++++++++++++++ libburn/init.h | 7 +++---- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index d20b4da..68e247e 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.06.06.173021" +#define Cdrskin_timestamP "2011.06.06.173611" diff --git a/libburn/init.c b/libburn/init.c index 234872b..3df3f2b 100644 --- a/libburn/init.c +++ b/libburn/init.c @@ -582,3 +582,18 @@ void burn_allow_drive_role_4(int allowed) { burn_drive_role_4_allowed = (allowed & 0xf); } + + +/* ts B10606 */ +void *burn_alloc_mem(size_t size, size_t count, int flag) +{ + void *pt; + + pt = calloc(size, count); + if(pt == NULL) + libdax_msgs_submit(libdax_messenger, -1, 0x00000003, + LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH, + "Out of virtual memory", 0, 0); + return pt; +} + diff --git a/libburn/init.h b/libburn/init.h index 9cc8eb3..6370d49 100644 --- a/libburn/init.h +++ b/libburn/init.h @@ -27,13 +27,12 @@ extern volatile int burn_builtin_triggered_action; /* burn_is_aborting() */ */ int burn_init_catch_on_abort(int flag); +/* ts B10606 */ +void *burn_alloc_mem(size_t size, size_t count, int flag); #define BURN_ALLOC_MEM(pt, typ, count) { \ - pt= (typ *) calloc(1, (count)*sizeof(typ)); \ + pt= (typ *) burn_alloc_mem(sizeof(typ), (size_t) (count), 0); \ if(pt == NULL) { \ - libdax_msgs_submit(libdax_messenger, -1, 0x00000003, \ - LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH, \ - "Out of virtual memory", 0, 0); \ ret= -1; goto ex; \ } }