Windows NT 4.0 source code leak
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.

77 lines
883 B

4 years ago
  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. Mem.hxx
  6. Abstract:
  7. Memory header
  8. Must include Common.hxx.
  9. Author:
  10. Albert Ting (AlbertT) 20-May-1994
  11. Revision History:
  12. --*/
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. PVOID
  17. AllocMem(
  18. UINT cbSize
  19. );
  20. VOID
  21. FreeMem(
  22. PVOID pMem
  23. );
  24. #if DBG
  25. PVOID
  26. DbgAllocMem(
  27. UINT cbSize
  28. );
  29. VOID
  30. DbgFreeMem(
  31. PVOID pMem
  32. );
  33. #endif
  34. #ifdef __cplusplus
  35. }
  36. #endif
  37. #ifdef __cplusplus
  38. /********************************************************************
  39. The following are used if you want to override a classes'
  40. new and delete using SAFE_NEW.
  41. ********************************************************************/
  42. inline
  43. PVOID
  44. SafeNew(
  45. size_t size
  46. )
  47. {
  48. return AllocMem(size);
  49. }
  50. inline
  51. VOID
  52. SafeDelete(
  53. PVOID pVoid)
  54. {
  55. FreeMem( pVoid );
  56. }
  57. #endif