[PATCH] [asan] LSan hooks in asan_allocator2.cc
Sergey Matveev
earthdok at google.com
Mon May 20 08:37:54 PDT 2013
================
Comment at: lib/asan/asan_allocator2.cc:31
@@ -30,1 +30,3 @@
+#if SANITIZE_LEAKS
+#include "lsan/lsan_common.h"
----------------
Kostya Serebryany wrote:
> no #ifs please
removed
================
Comment at: lib/asan/asan_allocator2.cc:171
@@ -166,1 +170,3 @@
u32 rz_log : 3;
+#if SANITIZE_LEAKS
+ u32 lsan_tag : 2;
----------------
Kostya Serebryany wrote:
> no #ifs please
removed
================
Comment at: lib/asan/asan_allocator2.cc:711
@@ +710,3 @@
+// --- Implementation of LSan-specific functions --- {{{1
+#if SANITIZE_LEAKS
+namespace __lsan {
----------------
Sergey Matveev wrote:
> Kostya Serebryany wrote:
> > can you avoid this #if here too?
> yes, if we get rid of templates
reduced the scope of this #if for the time being
================
Comment at: lib/asan/asan_allocator2.cc:731
@@ +730,3 @@
+ uptr chunk = m->Beg();
+ if ((m->chunk_state == __asan::CHUNK_ALLOCATED) && (addr >= chunk) &&
+ addr < chunk + m->UsedSize())
----------------
Kostya Serebryany wrote:
> This should be a method of AsanChunk
> There is AddrIsInside in AsanChunkView, but not in AsanChunk
>
done
================
Comment at: lib/asan/asan_allocator2.cc:765
@@ +764,3 @@
+ __asan::AsanChunk *m = reinterpret_cast<__asan::AsanChunk *>(metadata_);
+ return m->user_requested_size;
+}
----------------
also fixed a bug here
http://llvm-reviews.chandlerc.com/D827
More information about the llvm-commits
mailing list