00001 #ifndef Allocation_Macros_h
00002 #define Allocation_Macros_h
00003
00004 #include "ace/Malloc_Base.h"
00005
00006 # define ACE_ALLOCATOR_NEW(POINTER,CONSTRUCTOR,RET_VAL) \
00007 do { void* ptr = ACE_Allocator::instance ()->malloc (sizeof (CONSTRUCTOR)); \
00008 if (ptr == 0) { POINTER = 0; errno = ENOMEM; return RET_VAL;} \
00009 else { POINTER = new (ptr) CONSTRUCTOR; } \
00010 } while (0)
00011 # define ACE_ALLOCATOR_NEW_RETURN(POINTER,CONSTRUCTOR) \
00012 do { void* ptr = ACE_Allocator::instance ()->malloc (sizeof (CONSTRUCTOR));; \
00013 if (ptr == 0) { POINTER = 0; errno = ENOMEM; return;} \
00014 else { POINTER = new (POINTER) CONSTRUCTOR; } \
00015 } while (0)
00016 # define ACE_ALLOCATOR_NEW_NORETURN(POINTER,CONSTRUCTOR) \
00017 do { void* ptr = ACE_Allocator::instance ()->malloc (sizeof (CONSTRUCTOR));; \
00018 if (ptr == 0) { POINTER = 0; errno = ENOMEM;} \
00019 else { (POINTER = new (POINTER) CONSTRUCTOR; } \
00020 } while (0)
00021
00022 #endif