OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <HTML> | 2 <HTML> |
3 | 3 |
4 <HEAD> | 4 <HEAD> |
5 <link rel="stylesheet" href="designstyle.css"> | 5 <link rel="stylesheet" href="designstyle.css"> |
6 <title>Google Heap Leak Checker</title> | 6 <title>Gperftools Heap Leak Checker</title> |
7 </HEAD> | 7 </HEAD> |
8 | 8 |
9 <BODY> | 9 <BODY> |
10 | 10 |
11 <p align=right> | 11 <p align=right> |
12 <i>Last modified | 12 <i>Last modified |
13 <script type=text/javascript> | 13 <script type=text/javascript> |
14 var lm = new Date(document.lastModified); | 14 var lm = new Date(document.lastModified); |
15 document.write(lm.toDateString()); | 15 document.write(lm.toDateString()); |
16 </script></i> | 16 </script></i> |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 <h2><a name="explicit">Explicit (Partial-program) Heap Leak Checking</h2> | 163 <h2><a name="explicit">Explicit (Partial-program) Heap Leak Checking</h2> |
164 | 164 |
165 <p>Instead of whole-program checking, you can check certain parts of your | 165 <p>Instead of whole-program checking, you can check certain parts of your |
166 code to verify they do not have memory leaks. This check verifies that | 166 code to verify they do not have memory leaks. This check verifies that |
167 between two parts of a program, no memory is allocated without being freed.</p> | 167 between two parts of a program, no memory is allocated without being freed.</p> |
168 <p>To use this kind of checking code, bracket the code you want | 168 <p>To use this kind of checking code, bracket the code you want |
169 checked by creating a <code>HeapLeakChecker</code> object at the | 169 checked by creating a <code>HeapLeakChecker</code> object at the |
170 beginning of the code segment, and call | 170 beginning of the code segment, and call |
171 <code>NoLeaks()</code> at the end. These functions, and all others | 171 <code>NoLeaks()</code> at the end. These functions, and all others |
172 referred to in this file, are declared in | 172 referred to in this file, are declared in |
173 <code><google/heap-checker.h></code>. | 173 <code><gperftools/heap-checker.h></code>. |
174 </p> | 174 </p> |
175 | 175 |
176 <p>Here's an example:</p> | 176 <p>Here's an example:</p> |
177 <pre> | 177 <pre> |
178 HeapLeakChecker heap_checker("test_foo"); | 178 HeapLeakChecker heap_checker("test_foo"); |
179 { | 179 { |
180 code that exercises some foo functionality; | 180 code that exercises some foo functionality; |
181 this code should not leak memory; | 181 this code should not leak memory; |
182 } | 182 } |
183 if (!heap_checker.NoLeaks()) assert(NULL == "heap memory leak"); | 183 if (!heap_checker.NoLeaks()) assert(NULL == "heap memory leak"); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 <hr> | 526 <hr> |
527 <address>Maxim Lifantsev<br> | 527 <address>Maxim Lifantsev<br> |
528 <!-- Created: Tue Dec 19 10:43:14 PST 2000 --> | 528 <!-- Created: Tue Dec 19 10:43:14 PST 2000 --> |
529 <!-- hhmts start --> | 529 <!-- hhmts start --> |
530 Last modified: Fri Jul 13 13:14:33 PDT 2007 | 530 Last modified: Fri Jul 13 13:14:33 PDT 2007 |
531 <!-- hhmts end --> | 531 <!-- hhmts end --> |
532 </address> | 532 </address> |
533 </body> | 533 </body> |
534 </html> | 534 </html> |
OLD | NEW |