void * operator new(size_t _Size) { // replace operator new void * _Ptr = _malloc_dbg(_Size > 0 ? _Size : 1, _CRT_BLOCK, __FILE__, __LINE__); if (!_Ptr) _Xbad_alloc(); return (_Ptr); }
void *__CRTDECL operator new(size_t count) _THROW1(_STD bad_alloc) { // try to allocate size bytes void *p; while ((p = malloc(count)) == 0) if (_callnewh(count) == 0) { // report no memory _STD _Xbad_alloc(); } return (p); }