Leaked source code of windows server 2003
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.

43 lines
762 B

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Abstract:
  4. New and delete operators overriding for
  5. consistence memory management.
  6. Author:
  7. Souren Aghajanyan (sourenag) 24-Sep-2001
  8. Revision History:
  9. <alias> <date> <comments>
  10. --*/
  11. #pragma once
  12. //#define TrackPop DbgTrackPop
  13. //#define HINF PVOID
  14. //#include "top.h"
  15. #include "malloc.h"
  16. #define MALLOC(n) HeapAlloc(GetProcessHeap(), 0, n)
  17. #define FREE(x) HeapFree(GetProcessHeap(), 0, x)
  18. #define REALLOC(x, n) HeapReAlloc(GetProcessHeap(), 0, x, n)
  19. #ifdef __cplusplus
  20. inline void *operator new[](size_t size)
  21. {
  22. PVOID ptr = MALLOC(size);
  23. return ptr;
  24. }
  25. inline void operator delete[](void * ptr)
  26. {
  27. FREE(ptr);
  28. }
  29. #endif