asan/tsan: fix memory allocator statistics

llvm-svn: 172390
This commit is contained in:
Dmitry Vyukov 2013-01-14 08:51:08 +00:00
parent 064c739cea
commit 38092f628b
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@
// to a new one (version 2). The change is quite intrusive so both allocators // 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 // will co-exist in the source base for a while. The actual allocator is chosen
// at build time by redefining this macrozz. // at build time by redefining this macrozz.
#define ASAN_ALLOCATOR_VERSION 1 #define ASAN_ALLOCATOR_VERSION 2
namespace __asan { namespace __asan {

View File

@ -238,14 +238,14 @@ class SizeClassAllocator64 {
Batch *b = region->free_list.Pop(); Batch *b = region->free_list.Pop();
if (b == 0) if (b == 0)
b = PopulateFreeList(c, class_id, region); b = PopulateFreeList(c, class_id, region);
region->n_allocated++; region->n_allocated += b->count;
return b; return b;
} }
void NOINLINE DeallocateBatch(uptr class_id, Batch *b) { void NOINLINE DeallocateBatch(uptr class_id, Batch *b) {
RegionInfo *region = GetRegionInfo(class_id); RegionInfo *region = GetRegionInfo(class_id);
region->free_list.Push(b); region->free_list.Push(b);
region->n_freed++; region->n_freed += b->count;
} }
static bool PointerIsMine(void *p) { static bool PointerIsMine(void *p) {