Skip to content

Commit 1feab37

Browse files
committed
comments
1 parent 32f1a36 commit 1feab37

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎Objects/listobject.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,10 @@ _PyList_DebugMallocStats(FILE *out)
232232
static inline int
233233
maybe_small_list_freelist_push(PyObject *self)
234234
{
235+
// todo: in the resizing there are some alignments on the allocation. can we use that here?
235236
assert(PyList_CheckExact(self));
236237

237238
PyListObject *op = (PyListObject *)self;
238-
PyObject **ob_item = _Py_atomic_load_ptr(&op->ob_item);
239-
240239
Py_ssize_t allocated = op->allocated;
241240
if (allocated < PyList_MAXSAVESIZE) {
242241
return _Py_FREELIST_PUSH(small_lists[allocated], self, Py_small_lists_MAXFREELIST);
@@ -267,9 +266,9 @@ PyList_New(Py_ssize_t size)
267266
//printf("obtained list from small_lists[%d] (id %p, op->allocated %d, size %d, PyList_Size %d)\n", (int) size, op, (int)op->allocated, (int)size, (int)PyList_Size( (PyObject*)op));
268267
assert (op->allocated >= size);
269268
}
270-
op=0;
269+
//op=0;
271270
}
272-
if (!op) {
271+
if (op == NULL) {
273272
// do we still need this freelist? if so, we could store it at small_lists[PyList_MAXSAVESIZE-1] with some special casing
274273
op = _Py_FREELIST_POP(PyListObject, lists);
275274
if (op == NULL) {

0 commit comments

Comments
 (0)