summaryrefslogtreecommitdiff
path: root/runtime/linear_alloc.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-04-22 13:56:20 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-05-29 18:45:49 -0700
commite401d146407d61eeb99f8d6176b2ac13c4df1e33 (patch)
tree17927f9bfe7d2041b5942c89832d55f9dedb24c5 /runtime/linear_alloc.cc
parent2006b7b9b8e32722bd0d640c62549d8a0ac624b6 (diff)
Move mirror::ArtMethod to native
Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
Diffstat (limited to 'runtime/linear_alloc.cc')
-rw-r--r--runtime/linear_alloc.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/runtime/linear_alloc.cc b/runtime/linear_alloc.cc
index fe6bee6d02..43e81d9d94 100644
--- a/runtime/linear_alloc.cc
+++ b/runtime/linear_alloc.cc
@@ -23,6 +23,11 @@ namespace art {
LinearAlloc::LinearAlloc(ArenaPool* pool) : lock_("linear alloc"), allocator_(pool) {
}
+void* LinearAlloc::Realloc(Thread* self, void* ptr, size_t old_size, size_t new_size) {
+ MutexLock mu(self, lock_);
+ return allocator_.Realloc(ptr, old_size, new_size);
+}
+
void* LinearAlloc::Alloc(Thread* self, size_t size) {
MutexLock mu(self, lock_);
return allocator_.Alloc(size);
@@ -33,4 +38,14 @@ size_t LinearAlloc::GetUsedMemory() const {
return allocator_.BytesUsed();
}
+ArenaPool* LinearAlloc::GetArenaPool() {
+ MutexLock mu(Thread::Current(), lock_);
+ return allocator_.GetArenaPool();
+}
+
+bool LinearAlloc::Contains(void* ptr) const {
+ MutexLock mu(Thread::Current(), lock_);
+ return allocator_.Contains(ptr);
+}
+
} // namespace art