summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 3c4e2d2..7070165 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -192,6 +192,7 @@ list_preallocate_exact(PyListObject *self, Py_ssize_t size)
return -1;
}
items = array->ob_item;
+ memset(items, 0, size * sizeof(PyObject *));
#else
items = PyMem_New(PyObject*, size);
if (items == NULL) {
@@ -199,7 +200,7 @@ list_preallocate_exact(PyListObject *self, Py_ssize_t size)
return -1;
}
#endif
- self->ob_item = items;
+ FT_ATOMIC_STORE_PTR_RELEASE(self->ob_item, items);
self->allocated = size;
return 0;
}