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>
Tue, 19 Apr 2011 00:04:14 +0000 (17:04 -0700)
commitbdd06aadab6214d2378b7d5078f92bfb14e7e3dc
tree39951ae71851babcbd086b99f385b182c1f84d89
parent486ac3c0a90b05be5af4b82801ef325e83241057
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
Change-Id: I9cfe1b62ea61f03e46f44ad2be0d1cce1bef7cdd
vm/native/dalvik_system_VMRuntime.c