ACE_NEW开头的宏定义
2015-08-10 09:07
393 查看
# if defined (ACE_HAS_NEW_NOTHROW) # define ACE_NEW_RETURN(POINTER,CONSTRUCTOR,RET_VAL) \ do { POINTER = new (ACE_nothrow) CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; return RET_VAL; } \ } while (0) # define ACE_NEW(POINTER,CONSTRUCTOR) \ do { POINTER = new(ACE_nothrow) CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; return; } \ } while (0) # define ACE_NEW_NORETURN(POINTER,CONSTRUCTOR) \ do { POINTER = new(ACE_nothrow) CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; } \ } while (0) # else # define ACE_NEW_RETURN(POINTER,CONSTRUCTOR,RET_VAL) \ do { try { POINTER = new CONSTRUCTOR; } \ catch (ACE_bad_alloc) { ACE_del_bad_alloc errno = ENOMEM; POINTER = 0; return RET_VAL; } \ } while (0) # define ACE_NEW(POINTER,CONSTRUCTOR) \ do { try { POINTER = new CONSTRUCTOR; } \ catch (ACE_bad_alloc) { ACE_del_bad_alloc errno = ENOMEM; POINTER = 0; return; } \ } while (0) # define ACE_NEW_NORETURN(POINTER,CONSTRUCTOR) \ do { try { POINTER = new CONSTRUCTOR; } \ catch (ACE_bad_alloc) { ACE_del_bad_alloc errno = ENOMEM; POINTER = 0; } \ } while (0) # endif /* ACE_HAS_NEW_NOTHROW */ #else /* ACE_NEW_THROWS_EXCEPTIONS */ # define ACE_NEW_RETURN(POINTER,CONSTRUCTOR,RET_VAL) \ do { POINTER = new CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; return RET_VAL; } \ } while (0) # define ACE_NEW(POINTER,CONSTRUCTOR) \ do { POINTER = new CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; return; } \ } while (0) # define ACE_NEW_NORETURN(POINTER,CONSTRUCTOR) \ do { POINTER = new CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; } \ } while (0)
相关文章推荐
- ACE反应器(Reactor)模式的深入分析
- Leanote集成Ace代码编辑器, 程序员的最爱
- 【原创】基于ACE Proactor框架下高并发、大容量吞吐程序设计既最近的一个产品开发总结
- Ace 1.3.1 网站管理后台源码 Bootstrap响应式模板主题
- WIN7+VS2010 ACE配置
- ACE编译与安装
- Centos 编译安装ACE
- aceadmin源码
- windows下ACE怎样安装与使用说明?
- ACE:多线程简介
- ACE的安装
- ACE在Windows下的简单编译过程
- ACE和TAO编译时支持Unicode字符集和Qt
- 关于ACE_Asynch_Acceptor::accept 内存泄露的问题(Windows)
- 基于ACE的线程池学习与实现(一)——ACE_Task
- 基于ACE的线程池学习与实现(二)——ACE_Message_Block与ACE_Condition
- 基于ACE的线程池学习与实现(三)—— 并发编程资料
- ACE6.3.1 vs2010搭建ACE开发环境
- 全球Oracle ACE名单
- ACE读书笔记