Leaner implementation of macro BURN_ALLOC_MEM
This commit is contained in:
parent
178dd61cb1
commit
fc905fea5c
@ -1 +1 @@
|
|||||||
#define Cdrskin_timestamP "2011.06.06.173021"
|
#define Cdrskin_timestamP "2011.06.06.173611"
|
||||||
|
@ -582,3 +582,18 @@ void burn_allow_drive_role_4(int allowed)
|
|||||||
{
|
{
|
||||||
burn_drive_role_4_allowed = (allowed & 0xf);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -27,13 +27,12 @@ extern volatile int burn_builtin_triggered_action; /* burn_is_aborting() */
|
|||||||
*/
|
*/
|
||||||
int burn_init_catch_on_abort(int flag);
|
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) { \
|
#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) { \
|
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; \
|
ret= -1; goto ex; \
|
||||||
} }
|
} }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user