| OLD | NEW |
| 1 // Copyright (c) 2005, Google Inc. | 1 // Copyright (c) 2005, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // These used to be different but are all the same now: they return | 129 // These used to be different but are all the same now: they return |
| 130 // true iff all memory allocated since this HeapLeakChecker object | 130 // true iff all memory allocated since this HeapLeakChecker object |
| 131 // was constructor is still reachable from global state. | 131 // was constructor is still reachable from global state. |
| 132 // | 132 // |
| 133 // Because we fork to convert addresses to symbol-names, and forking | 133 // Because we fork to convert addresses to symbol-names, and forking |
| 134 // is not thread-safe, and we may be called in a threaded context, | 134 // is not thread-safe, and we may be called in a threaded context, |
| 135 // we do not try to symbolize addresses when called manually. | 135 // we do not try to symbolize addresses when called manually. |
| 136 bool NoLeaks() { return DoNoLeaks(DO_NOT_SYMBOLIZE); } | 136 bool NoLeaks() { return DoNoLeaks(DO_NOT_SYMBOLIZE); } |
| 137 | 137 |
| 138 // These forms are obsolete; use NoLeaks() instead. | 138 // These forms are obsolete; use NoLeaks() instead. |
| 139 // TODO(csilvers): mark with ATTRIBUTE_DEPRECATED. | 139 // TODO(csilvers): mark as DEPRECATED. |
| 140 bool QuickNoLeaks() { return NoLeaks(); } | 140 bool QuickNoLeaks() { return NoLeaks(); } |
| 141 bool BriefNoLeaks() { return NoLeaks(); } | 141 bool BriefNoLeaks() { return NoLeaks(); } |
| 142 bool SameHeap() { return NoLeaks(); } | 142 bool SameHeap() { return NoLeaks(); } |
| 143 bool QuickSameHeap() { return NoLeaks(); } | 143 bool QuickSameHeap() { return NoLeaks(); } |
| 144 bool BriefSameHeap() { return NoLeaks(); } | 144 bool BriefSameHeap() { return NoLeaks(); } |
| 145 | 145 |
| 146 // Detailed information about the number of leaked bytes and objects | 146 // Detailed information about the number of leaked bytes and objects |
| 147 // (both of these can be negative as well). | 147 // (both of these can be negative as well). |
| 148 // These are available only after a *SameHeap or *NoLeaks | 148 // These are available only after a *SameHeap or *NoLeaks |
| 149 // method has been called. | 149 // method has been called. |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 // (they run only if we are doing heap leak checking.) | 409 // (they run only if we are doing heap leak checking.) |
| 410 // 'body' should be the cleanup code to run. 'name' doesn't matter, | 410 // 'body' should be the cleanup code to run. 'name' doesn't matter, |
| 411 // but must be unique amongst all REGISTER_HEAPCHECK_CLEANUP calls. | 411 // but must be unique amongst all REGISTER_HEAPCHECK_CLEANUP calls. |
| 412 #define REGISTER_HEAPCHECK_CLEANUP(name, body) \ | 412 #define REGISTER_HEAPCHECK_CLEANUP(name, body) \ |
| 413 namespace { \ | 413 namespace { \ |
| 414 void heapcheck_cleanup_##name() { body; } \ | 414 void heapcheck_cleanup_##name() { body; } \ |
| 415 static HeapCleaner heapcheck_cleaner_##name(&heapcheck_cleanup_##name); \ | 415 static HeapCleaner heapcheck_cleaner_##name(&heapcheck_cleanup_##name); \ |
| 416 } | 416 } |
| 417 | 417 |
| 418 #endif // BASE_HEAP_CHECKER_H_ | 418 #endif // BASE_HEAP_CHECKER_H_ |
| OLD | NEW |