Change AtomicStack to use StackReference
Previously used Object*, using StackReference saves memory on 64 bit
devices.
Bug: 12935052
Bug: 17643507
Change-Id: I035878690054eeeb24d655a900b8f26c837703ff
diff --git a/runtime/thread.h b/runtime/thread.h
index 7db9ba5..6c6dc51 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -807,10 +807,12 @@
// Push an object onto the allocation stack.
- bool PushOnThreadLocalAllocationStack(mirror::Object* obj);
+ bool PushOnThreadLocalAllocationStack(mirror::Object* obj)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
// Set the thread local allocation pointers to the given pointers.
- void SetThreadLocalAllocationStack(mirror::Object** start, mirror::Object** end);
+ void SetThreadLocalAllocationStack(StackReference<mirror::Object>* start,
+ StackReference<mirror::Object>* end);
// Resets the thread local allocation pointers.
void RevokeThreadLocalAllocationStack();
@@ -1149,8 +1151,8 @@
void* rosalloc_runs[kNumRosAllocThreadLocalSizeBrackets];
// Thread-local allocation stack data/routines.
- mirror::Object** thread_local_alloc_stack_top;
- mirror::Object** thread_local_alloc_stack_end;
+ StackReference<mirror::Object>* thread_local_alloc_stack_top;
+ StackReference<mirror::Object>* thread_local_alloc_stack_end;
// Support for Mutex lock hierarchy bug detection.
BaseMutex* held_mutexes[kLockLevelCount];