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.

34 lines
617 B

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) 1999-1999 Microsoft Corporation
  6. //
  7. // File: opnew.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // OpNew.cpp
  11. //
  12. // Override operator new[] so that we ignore the new_handler mechanism.
  13. //
  14. //
  15. #include <windows.h>
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include "Debug.h"
  19. LPVOID __cdecl operator new(size_t cbBuffer)
  20. {
  21. LPVOID p;
  22. p = malloc(cbBuffer ? cbBuffer : 1);
  23. return p;
  24. }
  25. void __cdecl operator delete(LPVOID p)
  26. {
  27. free(p);
  28. }