Skip to content

Commit 42c7abb

Browse files
committed
cleanup
1 parent ba00c15 commit 42c7abb

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

Objects/listobject.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ _PyList_DebugMallocStats(FILE *out)
234234
static inline int
235235
maybe_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

0 commit comments

Comments
 (0)