12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #include <stdlib.h>
- #include <new>
- #include "sgx_defs.h"
- #include "sgx_trts.h"
- #include "internal/se_cdefs.h"
- #include "internal/cpprt_internal.h"
- SGX_WEAK void* SGXAPI operator new(size_t dwBytes) throw(std::bad_alloc)
- {
- void* address = malloc(dwBytes);
- while ( address == NULL ){
- if ( !call_newh() ){
- throw std::bad_alloc();
- }
- address = malloc(dwBytes);
- }
- return address;
- }
|