diff options
author | Hiroshi Yamauchi <yamauchi@google.com> | 2013-12-17 17:19:53 -0800 |
---|---|---|
committer | Hiroshi Yamauchi <yamauchi@google.com> | 2013-12-18 11:26:15 -0800 |
commit | e48780b8278240dec2d3164512f7d3317a5495c1 (patch) | |
tree | addc42318a8747927a7ff5d10e786648574e34c3 /runtime/gc/space/dlmalloc_space.cc | |
parent | 0bf1f266869776c2dd21b3242599d74ac80855f0 (diff) | |
download | art-e48780b8278240dec2d3164512f7d3317a5495c1.tar.gz |
Remove some unnecessary code from dlmalloc_space/rosalloc_space.
Removed GetTotalBytesAllocated(), GetTotalObjectsAllocated(), and
InternalAllocationSize().
No performance improvement observed.
Change-Id: Ie20433a0fd328fc7f61d4afd54d18fbdc4aa4a17
Diffstat (limited to 'runtime/gc/space/dlmalloc_space.cc')
-rw-r--r-- | runtime/gc/space/dlmalloc_space.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/runtime/gc/space/dlmalloc_space.cc b/runtime/gc/space/dlmalloc_space.cc index 10e9ed8cf5..a4e6edadef 100644 --- a/runtime/gc/space/dlmalloc_space.cc +++ b/runtime/gc/space/dlmalloc_space.cc @@ -38,7 +38,7 @@ static const bool kPrefetchDuringDlMallocFreeList = true; DlMallocSpace::DlMallocSpace(const std::string& name, MemMap* mem_map, void* mspace, byte* begin, byte* end, byte* limit, size_t growth_limit) : MallocSpace(name, mem_map, begin, end, limit, growth_limit), - total_bytes_freed_(0), total_objects_freed_(0), mspace_(mspace), mspace_for_alloc_(mspace) { + mspace_(mspace), mspace_for_alloc_(mspace) { CHECK(mspace != NULL); } @@ -148,9 +148,7 @@ size_t DlMallocSpace::Free(Thread* self, mirror::Object* ptr) { CHECK(ptr != NULL); CHECK(Contains(ptr)) << "Free (" << ptr << ") not in bounds of heap " << *this; } - const size_t bytes_freed = InternalAllocationSize(ptr); - total_bytes_freed_ += bytes_freed; - ++total_objects_freed_; + const size_t bytes_freed = AllocationSizeNonvirtual(ptr); if (kRecentFreeCount > 0) { RegisterRecentFree(ptr); } @@ -170,7 +168,7 @@ size_t DlMallocSpace::FreeList(Thread* self, size_t num_ptrs, mirror::Object** p // The head of chunk for the allocation is sizeof(size_t) behind the allocation. __builtin_prefetch(reinterpret_cast<char*>(ptrs[i + look_ahead]) - sizeof(size_t)); } - bytes_freed += InternalAllocationSize(ptr); + bytes_freed += AllocationSizeNonvirtual(ptr); } if (kRecentFreeCount > 0) { @@ -196,8 +194,6 @@ size_t DlMallocSpace::FreeList(Thread* self, size_t num_ptrs, mirror::Object** p { MutexLock mu(self, lock_); - total_bytes_freed_ += bytes_freed; - total_objects_freed_ += num_ptrs; mspace_bulk_free(mspace_, reinterpret_cast<void**>(ptrs), num_ptrs); return bytes_freed; } @@ -211,13 +207,8 @@ extern "C" void* art_heap_morecore(void* mspace, intptr_t increment) { return heap->GetNonMovingSpace()->MoreCore(increment); } -// Virtual functions can't get inlined. -inline size_t DlMallocSpace::InternalAllocationSize(const mirror::Object* obj) { - return AllocationSizeNonvirtual(obj); -} - size_t DlMallocSpace::AllocationSize(const mirror::Object* obj) { - return InternalAllocationSize(obj); + return AllocationSizeNonvirtual(obj); } size_t DlMallocSpace::Trim() { |