diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-08-26 23:28:53 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-26 23:28:53 +0000 |
commit | a2cb85a2bf6abc28a177f6b41ded01c55483baa1 (patch) | |
tree | 3237b8353f2208a205eb06c9dc1796a5590a9b1b /compiler/dex/growable_array.h | |
parent | e2be9da597c69b92ffb707f2101b96076578b5e6 (diff) | |
parent | f6c4b3ba3825de1dbb3e747a68b809c6cc8eb4db (diff) | |
download | android_art-a2cb85a2bf6abc28a177f6b41ded01c55483baa1.tar.gz android_art-a2cb85a2bf6abc28a177f6b41ded01c55483baa1.tar.bz2 android_art-a2cb85a2bf6abc28a177f6b41ded01c55483baa1.zip |
Merge "New arena memory allocator." into dalvik-dev
Diffstat (limited to 'compiler/dex/growable_array.h')
-rw-r--r-- | compiler/dex/growable_array.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/dex/growable_array.h b/compiler/dex/growable_array.h index 08a6478e97..8e2abfbaf1 100644 --- a/compiler/dex/growable_array.h +++ b/compiler/dex/growable_array.h @@ -67,7 +67,7 @@ class GrowableArray { } static void* operator new(size_t size, ArenaAllocator* arena) { - return arena->NewMem(sizeof(GrowableArray::Iterator), true, ArenaAllocator::kAllocGrowableArray); + return arena->Alloc(sizeof(GrowableArray::Iterator), ArenaAllocator::kAllocGrowableArray); }; static void operator delete(void* p) {} // Nop. @@ -81,8 +81,8 @@ class GrowableArray { num_allocated_(init_length), num_used_(0), kind_(kind) { - elem_list_ = static_cast<T*>(arena_->NewMem(sizeof(T) * init_length, true, - ArenaAllocator::kAllocGrowableArray)); + elem_list_ = static_cast<T*>(arena_->Alloc(sizeof(T) * init_length, + ArenaAllocator::kAllocGrowableArray)); }; @@ -95,8 +95,8 @@ class GrowableArray { if (new_length > target_length) { target_length = new_length; } - T* new_array = static_cast<T*>(arena_->NewMem(sizeof(T) * target_length, true, - ArenaAllocator::kAllocGrowableArray)); + T* new_array = static_cast<T*>(arena_->Alloc(sizeof(T) * target_length, + ArenaAllocator::kAllocGrowableArray)); memcpy(new_array, elem_list_, sizeof(T) * num_allocated_); num_allocated_ = target_length; elem_list_ = new_array; @@ -153,7 +153,7 @@ class GrowableArray { T* GetRawStorage() const { return elem_list_; } static void* operator new(size_t size, ArenaAllocator* arena) { - return arena->NewMem(sizeof(GrowableArray<T>), true, ArenaAllocator::kAllocGrowableArray); + return arena->Alloc(sizeof(GrowableArray<T>), ArenaAllocator::kAllocGrowableArray); }; static void operator delete(void* p) {} // Nop. |