From 95e511b9844f50215d74fa69eed0013f46b3e2ea Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 15 May 2011 10:47:01 +0000 Subject: [PATCH] Macros BURN_ALLOC_MEM, BURN_FREE_MEM for replaceing local variables --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/init.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 2a9d52f..8f99fd3 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.05.12.135217" +#define Cdrskin_timestamP "2011.05.15.104727" diff --git a/libburn/init.h b/libburn/init.h index 9d09818..205982a 100644 --- a/libburn/init.h +++ b/libburn/init.h @@ -28,4 +28,19 @@ extern volatile int burn_builtin_triggered_action; /* burn_is_aborting() */ int burn_init_catch_on_abort(int flag); +#define BURN_ALLOC_MEM(pt, typ, anz) { \ + pt= (typ *) calloc(1, (anz)*sizeof(typ)); \ + if(pt == NULL) { \ + libdax_msgs_submit(libdax_messenger, -1, 0x00000003, \ + LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH, \ + "Out of virtual memory", 0, 0); \ + goto ex; \ + } } + +#define BURN_FREE_MEM(pt) { \ + if(pt != NULL) \ + free(pt); \ + } + + #endif /* BURN__INIT_H */