[llvm-commits] [compiler-rt] r172390 - in /compiler-rt/trunk/lib: asan/asan_allocator.h sanitizer_common/sanitizer_allocator.h

Dmitry Vyukov dvyukov at google.com
Mon Jan 14 00:51:08 PST 2013


Author: dvyukov
Date: Mon Jan 14 02:51:08 2013
New Revision: 172390

URL: http://llvm.org/viewvc/llvm-project?rev=172390&view=rev
Log:
asan/tsan: fix memory allocator statistics

Modified:
    compiler-rt/trunk/lib/asan/asan_allocator.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.h

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=172390&r1=172389&r2=172390&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_allocator.h (original)
+++ compiler-rt/trunk/lib/asan/asan_allocator.h Mon Jan 14 02:51:08 2013
@@ -23,7 +23,7 @@
 // to a new one (version 2). The change is quite intrusive so both allocators
 // will co-exist in the source base for a while. The actual allocator is chosen
 // at build time by redefining this macrozz.
-#define ASAN_ALLOCATOR_VERSION 1
+#define ASAN_ALLOCATOR_VERSION 2
 
 namespace __asan {
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.h?rev=172390&r1=172389&r2=172390&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.h Mon Jan 14 02:51:08 2013
@@ -238,14 +238,14 @@
     Batch *b = region->free_list.Pop();
     if (b == 0)
       b = PopulateFreeList(c, class_id, region);
-    region->n_allocated++;
+    region->n_allocated += b->count;
     return b;
   }
 
   void NOINLINE DeallocateBatch(uptr class_id, Batch *b) {
     RegionInfo *region = GetRegionInfo(class_id);
     region->free_list.Push(b);
-    region->n_freed++;
+    region->n_freed += b->count;
   }
 
   static bool PointerIsMine(void *p) {





More information about the llvm-commits mailing list