OSDN Git Service

Fix a type error in the allocation of non-moving arrays.
authorCarl Shapiro <cshapiro@google.com>
Mon, 18 Apr 2011 22:08:21 +0000 (15:08 -0700)
committerCarl Shapiro <cshapiro@google.com>
Wed, 20 Apr 2011 01:30:09 +0000 (18:30 -0700)
commite4195e1c91f4ea3c6192070fd3c9b9e4e6d429ae
treef3a9bf34968d89819bfb2e99edf3067c3f342c38
parenta0739ea3040b578a53de817688ab5e9f17c0ce72
Fix a type error in the allocation of non-moving arrays.

Originally, non-moving arrays were allocated with dvmAllocObjectArray.
However, dvmAllocObjectArray does not respect the width of the user
supplied element class and substitutes a hard coded value of 4 bytes.
This change replaces dvmAllocObjectArray with dvmAllocArrayByClass.
dvmAllocArrayByClass consults the element class for its width when
computing the storage size for the array being allocated.

Bug: 4309030
vm/native/dalvik_system_VMRuntime.c