* @param elements
* @return Object The new array
*/
public static Object allocPrimitiveArray(VmType<?> currentClass,
int atype, int elements) {
VmHeapManager hm = heapManager;
if (hm == null) {
heapManager = hm = VmUtils.getVm().getHeapManager();
}
if (false) {
if (atype == 5) {
if (VmSystem.isInitialized()) {
// Trace new char[]
VmUtils.getVm().getCounter(currentClass.getName()).add(elements);
}
}
}
final Object result = hm.newArray(VmType.getPrimitiveArrayClass(atype),
elements);
return result;
}