if (GC_TRIGGERGC)
if (VM.verboseGC)
  cloneArray (int numElements, int size, Object[] tib, Object cloneSrc)    throws OutOfMemoryError    {    int objaddr, objRef;        if (GC_COUNT_FAST_ALLOC) allocCount++;    if (DebugLink) VM_Scheduler.trace("cloneArray", "called");    VM_Processor st = VM_Processor.getCurrentProcessor();    if (size <= GC_MAX_SMALL_SIZE) {      VM_SizeControl  the_size  = st.GC_INDEX_ARRAY[size];      if (the_size.next_slot != 0) {  // fastest path        if (GC_COUNT_FAST_ALLOC) fastAllocCount++;        objaddr = the_size.next_slot;        if (DebugLink) {          if (!isValidSmallHeapPtr(objaddr)) VM.sysFail("Bad ptr");           if (!isPtrInBlock(objaddr, the_size)) VM.sysFail("Pointer out of block");        }        the_size.next_slot = VM_Magic.getMemoryWord(objaddr);        if (DebugLink && (the_size.next_slot != 0)) {          if (!isValidSmallHeapPtr(the_size.next_slot)) VM.sysFail("Bad ptr");          if (!isPtrInBlock(the_size.next_slot, the_size))            VM.sysFail("Pointer out of block");        }        VM_Memory.zero(objaddr, objaddr + size);        objaddr -= OBJECT_HEADER_OFFSET;        VM_Magic.setMemoryWord(objaddr + OBJECT_TIB_OFFSET,          VM_Magic.objectAsAddress(tib));        VM_Magic.setMemoryWord(objaddr + ARRAY_LENGTH_OFFSET, numElements);        if (cloneSrc != null) {          int cnt = size - ARRAY_HEADER_SIZE;          int src = VM_Magic.objectAsAddress(cloneSrc);          int dst = objaddr;          VM_Memory.aligned32Copy(dst, src, cnt);        }        return VM_Magic.addressAsObject(objaddr);      }      else objaddr = allocatey(the_size, tib, numElements, size, the_size.ndx);       if (objaddr == 0) {        if (GC_TRIGGERGC)         VM_Scheduler.trace(" gc collection triggered by smallarrayclone request ", "XX");        gc1();	// reset the_size in case we are on a different processor after GC	st = VM_Processor.getCurrentProcessor();	the_size  = st.GC_INDEX_ARRAY[size];	if (DEBUG_FREE) if (the_size.current_block != the_size.first_block) {		VM_Scheduler.trace(" After gc, current_block not reset ", "AAC1", the_size.ndx);		}      }      else {        if (cloneSrc != null) {          int cnt = size - ARRAY_HEADER_SIZE;          int src = VM_Magic.objectAsAddress(cloneSrc);          int dst = objaddr;          VM_Memory.aligned32Copy(dst, src, cnt);        }         return VM_Magic.addressAsObject(objaddr);      }			// setup for repeated gc's - see allocateScalar1()			while (true) {      // try fast path again      if (the_size.next_slot != 0) {  // fastest path        objaddr = the_size.next_slot;        if (DebugLink) {          if (!isValidSmallHeapPtr(objaddr)) VM.sysFail("Bad ptr");          if (!isPtrInBlock(objaddr, the_size)) VM.sysFail("Pointer out of block");         }        the_size.next_slot = VM_Magic.getMemoryWord(objaddr);        if (DebugLink && (the_size.next_slot != 0)) {           if (!isValidSmallHeapPtr(the_size.next_slot)) VM.sysFail("Bad ptr");          if (!isPtrInBlock(the_size.next_slot, the_size))             VM.sysFail("Pointer out of block");        }        VM_Magic.setMemoryWord(objaddr, 0);        objaddr -= OBJECT_HEADER_OFFSET;        VM_Magic.setMemoryWord(objaddr + OBJECT_TIB_OFFSET,        VM_Magic.objectAsAddress(tib));        VM_Magic.setMemoryWord(objaddr + ARRAY_LENGTH_OFFSET, numElements);        if (cloneSrc != null) {          int cnt = size - ARRAY_HEADER_SIZE;          int src = VM_Magic.objectAsAddress(cloneSrc);          int dst = objaddr;          VM_Memory.aligned32Copy(dst, src, cnt);        }        return VM_Magic.addressAsObject(objaddr);      }      else objaddr = allocatey(the_size, tib, numElements, size, the_size.ndx);      if (objaddr == 0) {    // failure        if (GC_TRIGGERGC)           VM_Scheduler.trace(" 2nd gc collection triggered by small array request", "CL", size);		    flag2nd = true;        gc1();        // reset the_size in case we are on a different processor after GC        st = VM_Processor.getCurrentProcessor();        the_size  = st.GC_INDEX_ARRAY[size];      }			else break;			}      if (cloneSrc != null) {        int cnt = size - ARRAY_HEADER_SIZE;        int src = VM_Magic.objectAsAddress(cloneSrc);        int dst = objaddr;        VM_Memory.aligned32Copy(dst, src, cnt);      }      return VM_Magic.addressAsObject(objaddr);    }        int memAddr = getlargeobj(size);    // address of head of new object    if (memAddr < 0) {      if (GC_TRIGGERGC)       VM_Scheduler.trace(" gc collection triggered by large array clone", "XX");      gc1();      memAddr = getlargeobj(size);			// TODO: fix for repeated gc's (see allocateScalar1())      if (memAddr < 0) {			  outOfLargeMemory(size, 8300);        // outOfLargeMemory does not return: following line is for compilation        return VM_Magic.addressAsObject(memAddr);      }    }    VM_Memory.zero(memAddr, memAddr + size);    objRef = memAddr - OBJECT_HEADER_OFFSET;    // set type information block in object header          int tibAddr = VM_Magic.objectAsAddress(tib);    VM_Magic.setMemoryWord(objRef + OBJECT_TIB_OFFSET, tibAddr);    VM_Magic.setMemoryWord(objRef + OBJECT_STATUS_OFFSET, 0);    // set .length field    VM_Magic.setMemoryWord(objRef + ARRAY_LENGTH_OFFSET, numElements);    // return object reference    if (cloneSrc != null) {      int cnt = size - ARRAY_HEADER_SIZE;      int src = VM_Magic.objectAsAddress(cloneSrc);      int dst = objRef;      VM_Memory.aligned32Copy(dst, src, cnt);    }    return VM_Magic.addressAsObject(objRef);    }