acl  3.5.3.0
vld.h
浏览该文件的文档.
1 ////////////////////////////////////////////////////////////////////////////////
2 // $Id: vld.h,v 1.27 2006/11/12 18:09:20 dmouldin Exp $
3 //
4 // Visual Leak Detector (Version 1.9d) - Import Library Header
5 // Copyright (c) 2006 Dan Moulding
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 //
12 // This library 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 GNU
15 // Lesser General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 // See COPYING.txt for the full terms of the GNU Lesser General Public License.
22 //
23 ////////////////////////////////////////////////////////////////////////////////
24 
25 #pragma once
26 
27 #ifdef _DEBUG
28 
29 #pragma comment(lib, "vld.lib")
30 
31 // Force a symbolic reference to the global VisualLeakDetector class object from
32 // the DLL. This enusres that the DLL is loaded and linked with the program,
33 // even if no code otherwise imports any of the DLL's exports.
34 #pragma comment(linker, "/include:__imp_?vld@@3VVisualLeakDetector@@A")
35 
36 ////////////////////////////////////////////////////////////////////////////////
37 //
38 // Visual Leak Detector APIs
39 //
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif // __cplusplus
44 
45 // VLDDisable - Disables Visual Leak Detector's memory leak detection at
46 // runtime. If memory leak detection is already disabled, then calling this
47 // function has no effect.
48 //
49 // Note: In multithreaded programs, this function operates on a per-thread
50 // basis. In other words, if you call this function from one thread, then
51 // memory leak detection is only disabled for that thread. If memory leak
52 // detection is enabled for other threads, then it will remain enabled for
53 // those other threads. It was designed to work this way to insulate you,
54 // the programmer, from having to ensure thread synchronization when calling
55 // VLDEnable() and VLDDisable(). Without this, calling these two functions
56 // unsychronized could result in unpredictable and unintended behavior.
57 // But this also means that if you want to disable memory leak detection
58 // process-wide, then you need to call this function from every thread in
59 // the process.
60 //
61 // Return Value:
62 //
63 // None.
64 //
65 __declspec(dllimport) void VLDDisable ();
66 
67 // VLDEnable - Enables Visual Leak Detector's memory leak detection at runtime.
68 // If memory leak detection is already enabled, which it is by default, then
69 // calling this function has no effect.
70 //
71 // Note: In multithreaded programs, this function operates on a per-thread
72 // basis. In other words, if you call this function from one thread, then
73 // memory leak detection is only enabled for that thread. If memory leak
74 // detection is disabled for other threads, then it will remain disabled for
75 // those other threads. It was designed to work this way to insulate you,
76 // the programmer, from having to ensure thread synchronization when calling
77 // VLDEnable() and VLDDisable(). Without this, calling these two functions
78 // unsychronized could result in unpredictable and unintended behavior.
79 // But this also means that if you want to enable memory leak detection
80 // process-wide, then you need to call this function from every thread in
81 // the process.
82 //
83 // Return Value:
84 //
85 // None.
86 //
87 __declspec(dllimport) void VLDEnable ();
88 
89 #ifdef __cplusplus
90 }
91 #endif // __cplusplus
92 
93 #else // !_DEBUG
94 
95 #define VLDEnable()
96 #define VLDDisable()
97 
98 #endif // _DEBUG
#define VLDEnable()
Definition: vld.h:95
#define VLDDisable()
Definition: vld.h:96