Skip to content

Commit 5236700

Browse files
committed
Add a comment regarding PyMem_RawMalloc()
1 parent b955d85 commit 5236700

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/pystate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3219,6 +3219,8 @@ int
32193219
PyInterpreterWeakRef_Get(PyInterpreterWeakRef *wref_ptr)
32203220
{
32213221
PyInterpreterState *interp = PyInterpreterState_Get();
3222+
/* PyInterpreterWeakRef_Close() can be called without an attached thread
3223+
state, so we have to use the raw allocator. */
32223224
_PyInterpreterWeakRef *wref = PyMem_RawMalloc(sizeof(_PyInterpreterWeakRef));
32233225
if (wref == NULL) {
32243226
PyErr_NoMemory();

0 commit comments

Comments
 (0)