@@ -186,7 +186,7 @@ PyByteArray_AsString(PyObject *self)
186186}
187187
188188static int
189- _PyByteArray_Resize_lock_held (PyObject * self , Py_ssize_t requested_size )
189+ bytearray_resize_lock_held (PyObject * self , Py_ssize_t requested_size )
190190{
191191 _Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED (self );
192192 void * sval ;
@@ -275,7 +275,7 @@ PyByteArray_Resize(PyObject *self, Py_ssize_t requested_size)
275275{
276276 int ret ;
277277 Py_BEGIN_CRITICAL_SECTION (self );
278- ret = _PyByteArray_Resize_lock_held (self , requested_size );
278+ ret = bytearray_resize_lock_held (self , requested_size );
279279 Py_END_CRITICAL_SECTION ();
280280 return ret ;
281281}
@@ -344,7 +344,7 @@ bytearray_iconcat_lock_held(PyObject *op, PyObject *other)
344344 return PyErr_NoMemory ();
345345 }
346346
347- if (_PyByteArray_Resize_lock_held ((PyObject * )self , size + vo .len ) < 0 ) {
347+ if (bytearray_resize_lock_held ((PyObject * )self , size + vo .len ) < 0 ) {
348348 PyBuffer_Release (& vo );
349349 return NULL ;
350350 }
@@ -413,7 +413,7 @@ bytearray_irepeat_lock_held(PyObject *op, Py_ssize_t count)
413413 return PyErr_NoMemory ();
414414 }
415415 const Py_ssize_t size = mysize * count ;
416- if (_PyByteArray_Resize_lock_held ((PyObject * )self , size ) < 0 ) {
416+ if (bytearray_resize_lock_held ((PyObject * )self , size ) < 0 ) {
417417 return NULL ;
418418 }
419419
@@ -561,7 +561,7 @@ bytearray_setslice_linear(PyByteArrayObject *self,
561561 memmove (buf + lo + bytes_len , buf + hi ,
562562 Py_SIZE (self ) - hi );
563563 }
564- if (_PyByteArray_Resize_lock_held ((PyObject * )self ,
564+ if (bytearray_resize_lock_held ((PyObject * )self ,
565565 Py_SIZE (self ) + growth ) < 0 ) {
566566 /* Issue #19578: Handling the memory allocation failure here is
567567 tricky here because the bytearray object has already been
@@ -589,7 +589,7 @@ bytearray_setslice_linear(PyByteArrayObject *self,
589589 return -1 ;
590590 }
591591
592- if (_PyByteArray_Resize_lock_held ((PyObject * )self ,
592+ if (bytearray_resize_lock_held ((PyObject * )self ,
593593 Py_SIZE (self ) + growth ) < 0 ) {
594594 return -1 ;
595595 }
@@ -833,7 +833,7 @@ bytearray_ass_subscript_lock_held(PyObject *op, PyObject *index, PyObject *value
833833 buf + cur ,
834834 PyByteArray_GET_SIZE (self ) - cur );
835835 }
836- if (_PyByteArray_Resize_lock_held ((PyObject * )self ,
836+ if (bytearray_resize_lock_held ((PyObject * )self ,
837837 PyByteArray_GET_SIZE (self ) - slicelen ) < 0 )
838838 return -1 ;
839839
@@ -1920,7 +1920,7 @@ bytearray_insert_impl(PyByteArrayObject *self, Py_ssize_t index, int item)
19201920 "cannot add more objects to bytearray" );
19211921 return NULL ;
19221922 }
1923- if (_PyByteArray_Resize_lock_held ((PyObject * )self , n + 1 ) < 0 )
1923+ if (bytearray_resize_lock_held ((PyObject * )self , n + 1 ) < 0 )
19241924 return NULL ;
19251925 buf = PyByteArray_AS_STRING (self );
19261926
@@ -2039,7 +2039,7 @@ bytearray_append_impl(PyByteArrayObject *self, int item)
20392039 "cannot add more objects to bytearray" );
20402040 return NULL ;
20412041 }
2042- if (_PyByteArray_Resize_lock_held ((PyObject * )self , n + 1 ) < 0 )
2042+ if (bytearray_resize_lock_held ((PyObject * )self , n + 1 ) < 0 )
20432043 return NULL ;
20442044
20452045 PyByteArray_AS_STRING (self )[n ] = item ;
@@ -2155,7 +2155,7 @@ bytearray_extend_impl(PyByteArrayObject *self, PyObject *iterable_of_ints)
21552155 buf_size = PY_SSIZE_T_MAX ;
21562156 else
21572157 buf_size = len + addition + 1 ;
2158- if (_PyByteArray_Resize_lock_held ((PyObject * )bytearray_obj , buf_size ) < 0 ) {
2158+ if (bytearray_resize_lock_held ((PyObject * )bytearray_obj , buf_size ) < 0 ) {
21592159 Py_DECREF (it );
21602160 Py_DECREF (bytearray_obj );
21612161 return NULL ;
@@ -2173,7 +2173,7 @@ bytearray_extend_impl(PyByteArrayObject *self, PyObject *iterable_of_ints)
21732173 }
21742174
21752175 /* Resize down to exact size. */
2176- if (_PyByteArray_Resize_lock_held ((PyObject * )bytearray_obj , len ) < 0 ) {
2176+ if (bytearray_resize_lock_held ((PyObject * )bytearray_obj , len ) < 0 ) {
21772177 Py_DECREF (bytearray_obj );
21782178 return NULL ;
21792179 }
@@ -2227,7 +2227,7 @@ bytearray_pop_impl(PyByteArrayObject *self, Py_ssize_t index)
22272227 buf = PyByteArray_AS_STRING (self );
22282228 value = buf [index ];
22292229 memmove (buf + index , buf + index + 1 , n - index );
2230- if (_PyByteArray_Resize_lock_held ((PyObject * )self , n - 1 ) < 0 )
2230+ if (bytearray_resize_lock_held ((PyObject * )self , n - 1 ) < 0 )
22312231 return NULL ;
22322232
22332233 return _PyLong_FromUnsignedChar ((unsigned char )value );
@@ -2260,7 +2260,7 @@ bytearray_remove_impl(PyByteArrayObject *self, int value)
22602260 return NULL ;
22612261
22622262 memmove (buf + where , buf + where + 1 , n - where );
2263- if (_PyByteArray_Resize_lock_held ((PyObject * )self , n - 1 ) < 0 )
2263+ if (bytearray_resize_lock_held ((PyObject * )self , n - 1 ) < 0 )
22642264 return NULL ;
22652265
22662266 Py_RETURN_NONE ;
0 commit comments