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.

95 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. dbgalloc.hxx
  6. Abstract:
  7. Debug allocation header file
  8. Author:
  9. Steve Kiraly (SteveKi) 24-May-1998
  10. Revision History:
  11. --*/
  12. #ifndef _DBGALLOC_HXX_
  13. #define _DBGALLOC_HXX_
  14. DEBUG_NS_BEGIN
  15. BOOL
  16. DebugLibraryInitializeHeap(
  17. VOID
  18. );
  19. BOOL
  20. DebugLibraryDestroyHeap(
  21. VOID
  22. );
  23. BOOL
  24. DebugLibraryWalkHeap(
  25. VOID
  26. );
  27. PVOID
  28. DebugLibraryMalloc(
  29. IN SIZE_T Size,
  30. IN VOID *pVoid,
  31. IN LPCTSTR pszFile,
  32. IN UINT uLine
  33. );
  34. VOID
  35. DebugLibraryFree(
  36. IN VOID *pData
  37. );
  38. DEBUG_NS_END
  39. //
  40. // Overload of new operator. ( must be inline )
  41. //
  42. static inline PVOID _cdecl operator new(size_t Size, LPCTSTR pszFile, UINT uLine)
  43. {
  44. return DEBUG_NS::DebugLibraryMalloc(Size, NULL, pszFile, uLine);
  45. }
  46. //
  47. // Overload of placement new operator. ( must be inline )
  48. //
  49. static inline PVOID _cdecl operator new(size_t Size, VOID *p, LPCTSTR pszFile, UINT uLine)
  50. {
  51. return DEBUG_NS::DebugLibraryMalloc(Size, p, pszFile, uLine);
  52. }
  53. //
  54. // Overload of delete operator. ( must be inline )
  55. //
  56. static inline VOID _cdecl operator delete(VOID *p)
  57. {
  58. DEBUG_NS::DebugLibraryFree(p);
  59. }
  60. //
  61. // Macro for allocating memory using new.
  62. //
  63. #define INTERNAL_NEW new( _T(__FILE__), __LINE__ )
  64. //
  65. // Macro for allocating memory using plcaement new.
  66. //
  67. #define INTERNAL_NEWP(p) new( (p), _T(__FILE__), __LINE__ )
  68. //
  69. // Macro for deleting memory
  70. //
  71. #define INTERNAL_DELETE delete
  72. #endif // _DBGALLOC_HXX_