home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / dbghook.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  1KB  |  53 lines

  1. /***
  2. *dbghook.c - Debug CRT Hook Functions
  3. *
  4. *       Copyright (c) 1988-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Allow users to override default alloc hook at link time.
  8. *
  9. *******************************************************************************/
  10.  
  11. #ifdef _DEBUG
  12.  
  13. #include <internal.h>
  14. #include <limits.h>
  15. #include <mtdll.h>
  16. #include <malloc.h>
  17. #include <stdlib.h>
  18. #include <dbgint.h>
  19.  
  20.  
  21. _CRT_ALLOC_HOOK _pfnAllocHook = _CrtDefaultAllocHook;
  22.  
  23.  
  24. /***
  25. *int _CrtDefaultAllocHook() - allow allocation
  26. *
  27. *Purpose:
  28. *       allow allocation
  29. *
  30. *Entry:
  31. *       all parameters ignored
  32. *
  33. *Exit:
  34. *       returns TRUE
  35. *
  36. *Exceptions:
  37. *
  38. *******************************************************************************/
  39. int __cdecl _CrtDefaultAllocHook(
  40.         int nAllocType,
  41.         void * pvData,
  42.         size_t nSize,
  43.         int nBlockUse,
  44.         long lRequest,
  45.         const unsigned char * szFileName,
  46.         int nLine
  47.         )
  48. {
  49.         return 1; /* allow all allocs/reallocs/frees */
  50. }
  51.  
  52. #endif  /* _DEBUG */
  53.