[PATCH] [lsan] Implement __lsan_suppress_object().
Kostya Serebryany
kcc at google.com
Mon Jun 3 07:22:11 PDT 2013
================
Comment at: include/sanitizer/lsan_interface.h:27
@@ -27,1 +26,3 @@
+ // The heap object into which p points will be treated as a non-leak.
+ void __lsan_suppress_object(const void *p);
#ifdef __cplusplus
----------------
why not ignore object?
Also, do we need unignore_object?
================
Comment at: lib/lsan/lsan_common.h:156
@@ -155,1 +155,3 @@
+enum SuppressObjectResult {
+ kOK,
----------------
enum here looks weird.
and then enum names too (esp kOk is awful)
================
Comment at: lib/lsan/lsan_allocator.cc:194
@@ +193,3 @@
+
+SuppressObjectResult SuppressObjectLocked(const void *p) {
+ void *chunk = allocator.GetBlockBegin(p);
----------------
you are duplicating code, aren't you?
================
Comment at: lib/sanitizer_common/sanitizer_allocator.h:347
@@ -346,3 +346,3 @@
- static bool PointerIsMine(void *p) {
+ static bool PointerIsMine(const void *p) {
return reinterpret_cast<uptr>(p) / kSpaceSize == kSpaceBeg / kSpaceSize;
----------------
Why do you need const here? (I think you don't)
http://llvm-reviews.chandlerc.com/D910
More information about the llvm-commits
mailing list