Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
524 B

  1. // newop operator new(size_t) for Microsoft C++
  2. #include <cstdlib>
  3. #include <new>
  4. _C_LIB_DECL
  5. int __cdecl _callnewh(size_t size) _THROW1(_STD bad_alloc);
  6. _END_C_LIB_DECL
  7. void *__cdecl operator new(size_t size) _THROW1(_STD bad_alloc)
  8. { // try to allocate size bytes
  9. void *p;
  10. while ((p = malloc(size)) == 0)
  11. if (_callnewh(size) == 0)
  12. _STD _Nomemory();
  13. return (p);
  14. }
  15. /*
  16. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  17. * Consult your license regarding permissions and restrictions.
  18. V2.3:0009 */