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.

54 lines
900 B

  1. /*----------------------------------------------------------------------------
  2. alloc.h
  3. Copyright (C) Microsoft Corporation, 1993 - 1998
  4. All rights reserved.
  5. Authors:
  6. kennt Kenn Takara
  7. ----------------------------------------------------------------------------*/
  8. #ifndef _ALLOC_H
  9. #define _ALLOC_H
  10. #if _MSC_VER >= 1000 // VC 5.0 or later
  11. #pragma once
  12. #endif
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. void * TFSAlloc(size_t size);
  17. void TFSFree(void *pv);
  18. inline void * __cdecl operator new (size_t size)
  19. {
  20. return TFSAlloc(size);
  21. }
  22. inline void * __cdecl operator new[] (size_t size)
  23. {
  24. return TFSAlloc(size);
  25. }
  26. inline void * __cdecl operator delete (void * pv)
  27. {
  28. if (pv)
  29. TFSFree(pv);
  30. }
  31. inline void * __cdecl operator delete[] (void *pv)
  32. {
  33. if (pv)
  34. TFSFree(pv);
  35. }
  36. #ifdef __cplusplus
  37. } // extern "C"
  38. #endif
  39. #endif // _ALLOC_H