From 440b5d9bffafa46366f58599414e0cff35ea3a6a Mon Sep 17 00:00:00 2001 From: Alex Light Date: Tue, 24 Jan 2017 15:32:25 -0800 Subject: Implement class-pre-define time redefinition. This allows one to redefine classes as they are being loaded without restriction as to the types of transformations that may be included. For example one is allowed to add additional methods or fields to the class being defined. Bug: 31684920 Test: mma -j40 test-art-host Change-Id: I671ee13444c05f28424e727fd80d9d46c78ca287 --- runtime/mirror/array.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/mirror/array.h') diff --git a/runtime/mirror/array.h b/runtime/mirror/array.h index 19d300e1f4..16cf30f1e2 100644 --- a/runtime/mirror/array.h +++ b/runtime/mirror/array.h @@ -119,6 +119,10 @@ class MANAGED PrimitiveArray : public Array { static PrimitiveArray* Alloc(Thread* self, size_t length) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); + static PrimitiveArray* AllocateAndFill(Thread* self, const T* data, size_t length) + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); + + const T* GetData() const ALWAYS_INLINE REQUIRES_SHARED(Locks::mutator_lock_) { return reinterpret_cast(GetRawData(sizeof(T), 0)); } -- cgit v1.2.3-59-g8ed1b