optimization (or bug fix) depending on how you view it
authorbdemsky <bdemsky>
Wed, 22 Apr 2009 09:14:43 +0000 (09:14 +0000)
committerbdemsky <bdemsky>
Wed, 22 Apr 2009 09:14:43 +0000 (09:14 +0000)
Robust/src/ClassLibrary/Vector.java
Robust/src/Runtime/runtime.c

index 1795dace2e4037faf1fce558aa28ef012c1f3732..f4d1f954d1172b50c8458a711719eca2d2ff837e 100644 (file)
@@ -117,12 +117,12 @@ public class Vector {
       System.printString("Illegal Vector.removeElementAt\n");
       System.exit(-1);
     }
-    removeElement(array, index);
+    removeElement(array, index, size);
     size--;
     array[size]=null;
   }
 
-  public static native void removeElement(Object[] array, int index);
+  public static native void removeElement(Object[] array, int index, int size);
 
   public void removeAllElements() {
     int s = size;
index 8a68ee518261683b602a731f62d1d87b95966d27..da9796dd5c1921b2909b49c58f82d3c93f25fec8 100644 (file)
@@ -118,11 +118,10 @@ void CALL11(___System______exit____I,int ___status___, int ___status___) {
   exit(___status___);
 }
 
-#ifdef D___Vector______removeElement_____AR_L___Object____I
-void CALL12(___Vector______removeElement_____AR_L___Object____I, int ___index___, struct ArrayObject * ___array___, int ___index___) {
-  int length=VAR(___array___)->___length___;
+#ifdef D___Vector______removeElement_____AR_L___Object____II
+void CALL23(___Vector______removeElement_____AR_L___Object____II, int ___index___, int ___size___, struct ArrayObject * ___array___, int ___index___, int ___size___) {
   char* offset=((char *)(&VAR(___array___)->___length___))+sizeof(unsigned int)+sizeof(void *)*___index___;
-  memmove(offset, offset+sizeof(void *),(length-___index___-1)*sizeof(void *));
+  memmove(offset, offset+sizeof(void *),(___size___-___index___-1)*sizeof(void *));
 }
 #endif