@@ -688,7 +688,7 @@ Object extend(PArray self, PArray value) {
688
688
try {
689
689
int newLength = PythonUtils .addExact (self .getLength (), value .getLength ());
690
690
int itemsize = self .getFormat ().bytesize ;
691
- self .ensureCapacity (newLength );
691
+ self .resizeStorage (newLength );
692
692
PythonUtils .arraycopy (value .getBuffer (), 0 , self .getBuffer (), self .getLength () * itemsize , value .getLength () * itemsize );
693
693
self .setLength (newLength );
694
694
return PNone .NONE ;
@@ -708,7 +708,7 @@ Object extend(VirtualFrame frame, PArray self, PSequence value,
708
708
int storageLength = lenNode .execute (storage );
709
709
boolean capacityEnsured = false ;
710
710
try {
711
- self .ensureCapacity (PythonUtils .addExact (self .getLength (), storageLength ));
711
+ self .resizeStorage (PythonUtils .addExact (self .getLength (), storageLength ));
712
712
capacityEnsured = true ;
713
713
} catch (OverflowException e ) {
714
714
CompilerDirectives .transferToInterpreterAndInvalidate ();
@@ -724,7 +724,7 @@ Object extend(VirtualFrame frame, PArray self, PSequence value,
724
724
} else {
725
725
try {
726
726
length = PythonUtils .addExact (length , 1 );
727
- self .ensureCapacity (length );
727
+ self .resizeStorage (length );
728
728
} catch (OverflowException e ) {
729
729
CompilerDirectives .transferToInterpreterAndInvalidate ();
730
730
throw raise (MemoryError );
@@ -757,7 +757,7 @@ Object extend(VirtualFrame frame, PArray self, Object value,
757
757
// in CPython
758
758
try {
759
759
length = PythonUtils .addExact (length , 1 );
760
- self .ensureCapacity (length );
760
+ self .resizeStorage (length );
761
761
} catch (OverflowException e ) {
762
762
CompilerDirectives .transferToInterpreterAndInvalidate ();
763
763
throw raise (MemoryError );
@@ -936,7 +936,7 @@ Object fromlist(VirtualFrame frame, PArray self, PList list,
936
936
SequenceStorage storage = getSequenceStorageNode .execute (list );
937
937
int length = lenNode .execute (storage );
938
938
int newLength = PythonUtils .addExact (self .getLength (), length );
939
- self .ensureCapacity (newLength );
939
+ self .resizeStorage (newLength );
940
940
for (int i = 0 ; i < length ; i ++) {
941
941
putValueNode .execute (frame , self , self .getLength () + i , getItemScalarNode .execute (storage , i ));
942
942
}
@@ -988,7 +988,7 @@ Object fromunicode(VirtualFrame frame, PArray self, String str,
988
988
try {
989
989
int length = PString .codePointCount (str , 0 , str .length ());
990
990
int newLength = PythonUtils .addExact (self .getLength (), length );
991
- self .ensureCapacity (newLength );
991
+ self .resizeStorage (newLength );
992
992
for (int i = 0 , index = 0 ; i < length ; index ++) {
993
993
int cpCount = PString .charCount (PString .codePointAt (str , i ));
994
994
String value = PString .substring (str , i , i + cpCount );
0 commit comments