1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #include <stdlib.h>
- #include <new>
- #include "sgx_defs.h"
- #include "sgx_trts.h"
- #include "internal/util.h"
- #include "internal/cpprt_internal.h"
- SGX_WEAK void* SGXAPI operator new (size_t dwBytes, const std::nothrow_t& nothrow_constant)
- {
- UNUSED(nothrow_constant);
- void* address = malloc(dwBytes);
- while( address == NULL ){
- try {
- if ( !call_newh() ){
- return NULL;
- }
- }catch(...){
- return NULL;
- }
- address = malloc(dwBytes);
- }
- return address;
- }
|