libc++abi Specification

 

void* __cxa_allocate_exception(size_t thrown_size) throw();

Effects: Allocates memory to hold the exception to be thrown. thrown_size is the size of the exception object. Can allocate additional memory to hold private data. If memory can not be allocated, call std::terminate().

Returns: A pointer to the memory allocated for the exception object. 



void* __cxa_begin_catch(void* exceptionObject) throw();

Effects:

  • Increment's the exception's handler count.
  • Places the exception on the stack of currently-caught exceptions if it is not already there, linking the exception to the previous top of the stack.
  • Decrements the uncaught_exception count.

If the initialization of the catch parameter is trivial (e,g., there is no formal catch parameter, or the parameter has no copy constructor), the calls to __cxa_get_exception_ptr() and __cxa_begin_catch() may be combined into a single call to __cxa_begin_catch().

When the personality routine encounters a termination condition, it will call __cxa_begin_catch() to mark the exception as handled and then call terminate(), which shall not return to its caller.

Returns: The adjusted pointer to the exception object. 


void __cxa_end_catch();

Effects: Locates the most recently caught exception and decrements its handler count. Removes the exception from the caught脫exception stack, if the handler count goes to zero. Destroys the exception if the handler count goes to zero, and the exception was not re-thrown by throw. Collaboration between __cxa_rethrow() and __cxa_end_catch() is necessary to handle the last point. Though implementation-defined, one possibility is for __cxa_rethrow() to set a flag in the handlerCount member of the exception header to mark an exception being rethrown.


void __cxa_throw(void* thrown_exception, struct std::type_info * tinfo, void (*dest)(void*));
Effects:






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值