[compiler-rt] r279547 - [asan] minor fix in the asan memory profile

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 11:13:51 PDT 2016


Author: kcc
Date: Tue Aug 23 13:13:51 2016
New Revision: 279547

URL: http://llvm.org/viewvc/llvm-project?rev=279547&view=rev
Log:
[asan] minor fix in the asan memory profile

Modified:
    compiler-rt/trunk/lib/asan/asan_allocator.cc
    compiler-rt/trunk/lib/asan/asan_allocator.h
    compiler-rt/trunk/lib/asan/asan_memory_profile.cc

Modified: compiler-rt/trunk/lib/asan/asan_allocator.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator.cc?rev=279547&r1=279546&r2=279547&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_allocator.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_allocator.cc Tue Aug 23 13:13:51 2016
@@ -710,6 +710,9 @@ void GetAllocatorOptions(AllocatorOption
 AsanChunkView FindHeapChunkByAddress(uptr addr) {
   return instance.FindHeapChunkByAddress(addr);
 }
+AsanChunkView FindHeapChunkByAllocBeg(uptr addr) {
+  return AsanChunkView(instance.GetAsanChunk(reinterpret_cast<void*>(addr)));
+}
 
 void AsanThreadLocalMallocStorage::CommitBack() {
   instance.CommitBack(this);

Modified: compiler-rt/trunk/lib/asan/asan_allocator.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator.h?rev=279547&r1=279546&r2=279547&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_allocator.h (original)
+++ compiler-rt/trunk/lib/asan/asan_allocator.h Tue Aug 23 13:13:51 2016
@@ -91,6 +91,7 @@ class AsanChunkView {
 };
 
 AsanChunkView FindHeapChunkByAddress(uptr address);
+AsanChunkView FindHeapChunkByAllocBeg(uptr address);
 
 // List of AsanChunks with total size.
 class AsanChunkFifoList: public IntrusiveList<AsanChunk> {

Modified: compiler-rt/trunk/lib/asan/asan_memory_profile.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_memory_profile.cc?rev=279547&r1=279546&r2=279547&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_memory_profile.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_memory_profile.cc Tue Aug 23 13:13:51 2016
@@ -74,7 +74,7 @@ class HeapProfile {
 
 static void ChunkCallback(uptr chunk, void *arg) {
   HeapProfile *hp = reinterpret_cast<HeapProfile*>(arg);
-  AsanChunkView cv = FindHeapChunkByAddress(chunk);
+  AsanChunkView cv = FindHeapChunkByAllocBeg(chunk);
   if (!cv.IsAllocated()) return;
   u32 id = cv.GetAllocStackId();
   if (!id) return;




More information about the llvm-commits mailing list