asan/tsan: fix memory allocator statistics
llvm-svn: 172390
This commit is contained in:
parent
064c739cea
commit
38092f628b
|
@ -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 {
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue