mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Update PyObject_Del() documentation (#122597)
Replace PyMem_Del() with PyMem_Free().
This commit is contained in:
parent
03b88522f5
commit
addbb73927
4 changed files with 13 additions and 18 deletions
|
@ -269,16 +269,16 @@ test_type_from_ephemeral_spec(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
// (Explicitly overwrite memory before freeing,
|
||||
// so bugs show themselves even without the debug allocator's help.)
|
||||
memset(spec, 0xdd, sizeof(PyType_Spec));
|
||||
PyMem_Del(spec);
|
||||
PyMem_Free(spec);
|
||||
spec = NULL;
|
||||
memset(name, 0xdd, sizeof(NAME));
|
||||
PyMem_Del(name);
|
||||
PyMem_Free(name);
|
||||
name = NULL;
|
||||
memset(doc, 0xdd, sizeof(DOC));
|
||||
PyMem_Del(doc);
|
||||
PyMem_Free(doc);
|
||||
doc = NULL;
|
||||
memset(slots, 0xdd, 3 * sizeof(PyType_Slot));
|
||||
PyMem_Del(slots);
|
||||
PyMem_Free(slots);
|
||||
slots = NULL;
|
||||
|
||||
/* check that everything works */
|
||||
|
@ -304,10 +304,10 @@ test_type_from_ephemeral_spec(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
|
||||
result = Py_NewRef(Py_None);
|
||||
finally:
|
||||
PyMem_Del(spec);
|
||||
PyMem_Del(name);
|
||||
PyMem_Del(doc);
|
||||
PyMem_Del(slots);
|
||||
PyMem_Free(spec);
|
||||
PyMem_Free(name);
|
||||
PyMem_Free(doc);
|
||||
PyMem_Free(slots);
|
||||
Py_XDECREF(class);
|
||||
Py_XDECREF(instance);
|
||||
Py_XDECREF(obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue