vldapi.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ////////////////////////////////////////////////////////////////////////////////
  2. // $Id: vldapi.h,v 1.2.2.1 2005/08/03 23:14:26 dmouldin Exp $
  3. //
  4. // Visual Leak Detector (Version 1.0)
  5. // Copyright (c) 2005 Dan Moulding
  6. //
  7. // This program is free software; you can redistribute it and/or modify
  8. // it under the terms of the GNU Lesser General Public License as published by
  9. // the Free Software Foundation; either version 2.1 of the License, or
  10. // (at your option) any later version.
  11. //
  12. // This program is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. // GNU Lesser General Public License for more details.
  16. //
  17. // You should have received a copy of the GNU Lesser General Public License
  18. // along with this program; if not, write to the Free Software
  19. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. //
  21. // See COPYING.txt for the full terms of the GNU Lesser General Public License.
  22. //
  23. ////////////////////////////////////////////////////////////////////////////////
  24. #pragma once
  25. #ifdef _DEBUG
  26. ////////////////////////////////////////////////////////////////////////////////
  27. //
  28. // Visual Leak Detector APIs
  29. //
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif // __cplusplus
  33. // VLDEnable - Enables Visual Leak Detector's memory leak detection at runtime.
  34. // If memory leak detection is already enabled, which it is by default, then
  35. // calling this function has no effect.
  36. //
  37. // Note: In multithreaded programs, this function operates on a per-thread
  38. // basis. In other words, if you call this function from one thread, then
  39. // memory leak detection is only enabled for that thread. If memory leak
  40. // detection is disabled for other threads, then it will remain disabled for
  41. // those other threads. It was designed to work this way to insulate you,
  42. // the programmer, from having to ensure thread synchronization when calling
  43. // VLDEnable() and VLDDisable(). Without this, calling these two functions
  44. // unsychronized could result in unpredictable and unintended behavior.
  45. // But this also means that if you want to enable memory leak detection
  46. // process-wide, then you need to call this function from every thread in
  47. // the process.
  48. //
  49. // Return Value:
  50. //
  51. // None.
  52. //
  53. void VLDEnable ();
  54. // VLDDisable - Disables Visual Leak Detector's memory leak detection at
  55. // runtime. If memory leak detection is already disabled, then calling this
  56. // function has no effect.
  57. //
  58. // Note: In multithreaded programs, this function operates on a per-thread
  59. // basis. In other words, if you call this function from one thread, then
  60. // memory leak detection is only disabled for that thread. If memory leak
  61. // detection is enabled for other threads, then it will remain enabled for
  62. // those other threads. It was designed to work this way to insulate you,
  63. // the programmer, from having to ensure thread synchronization when calling
  64. // VLDEnable() and VLDDisable(). Without this, calling these two functions
  65. // unsychronized could result in unpredictable and unintended behavior.
  66. // But this also means that if you want to disable memory leak detection
  67. // process-wide, then you need to call this function from every thread in
  68. // the process.
  69. //
  70. // Return Value:
  71. //
  72. // None.
  73. //
  74. void VLDDisable ();
  75. #ifdef __cplusplus
  76. }
  77. #endif // __cplusplus
  78. #endif // _DEBUG