File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,7 +234,6 @@ _PyList_DebugMallocStats(FILE *out)
234234static inline int
235235maybe_small_list_freelist_push (PyObject * self )
236236{
237- // todo: in the resizing there are some alignments on the allocation. can we use that here?
238237 assert (PyList_CheckExact (self ));
239238
240239 PyListObject * op = (PyListObject * )self ;
@@ -259,17 +258,15 @@ PyList_New(Py_ssize_t size)
259258 if (size < PyList_MAXSAVESIZE ) {
260259 op = (PyListObject * )_Py_FREELIST_POP (PyLongObject , small_lists [size ]);
261260 if (op ) {
261+ assert (op -> allocated >= size );
262262 // allocated with ob_item still allocated, but we need to set the other fields
263263 Py_SET_SIZE (op , size );
264264 if ( size > 0 ) {
265265 memset (op -> ob_item , 0 , size * sizeof (PyObject * ));
266266 } else {
267- // might be relatex later
268267 op -> ob_item = NULL ;
269268 }
270- assert (op -> allocated >= size );
271269 }
272- //op=0;
273270 }
274271 if (op == NULL ) {
275272 // do we still need this freelist? if so, we could store it at small_lists[0] with some special casing
You can’t perform that action at this time.
0 commit comments