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.

46 lines
1.0 KiB

  1. #ifndef _TSUNAMI_MEM_H_INCLUDED_
  2. #define _TSUNAMI_MEM_H_INCLUDED_
  3. #if DBG
  4. PVOID DbgAllocateHeap
  5. (
  6. IN PCHAR File,
  7. IN int Line,
  8. IN ULONG Flags,
  9. IN ULONG Size
  10. );
  11. PVOID DbgReAllocateHeap
  12. (
  13. IN PCHAR File,
  14. IN int Line,
  15. IN ULONG Flags,
  16. IN PVOID pvOld,
  17. IN ULONG Size
  18. );
  19. BOOL DbgFreeHeap
  20. (
  21. IN PCHAR File,
  22. IN int Line,
  23. IN ULONG Flags,
  24. IN PVOID pvOld
  25. );
  26. #define ALLOC( Size ) (DbgAllocateHeap( __FILE__, __LINE__, 0, (Size) ) )
  27. #define TYPE_ALLOC( Type ) (ALLOC( sizeof( Type )))
  28. #define FREE( pv ) (DbgFreeHeap( __FILE__, __LINE__, 0, (pv) ))
  29. #define REALLOC( pv, Size ) (DbgReAllocateHeap( __FILE__, __LINE__, 0, pv, Size ) )
  30. #else // DBG
  31. #define ALLOC( Size ) (LocalAlloc( LPTR, (Size) ) )
  32. #define TYPE_ALLOC( Type ) (ALLOC( sizeof( Type )))
  33. #define FREE( pv ) (LocalFree( (pv) ))
  34. #define REALLOC( pv, Size ) ((PVOID) LocalReAlloc( pv, Size, 0 ) )
  35. #endif // DBG
  36. #endif // INCLUDED