summaryrefslogtreecommitdiff
path: root/Modules/gcmodule.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-05-21 19:18:41 -0700
committerGitHub <noreply@github.com>2018-05-21 19:18:41 -0700
commit0c1e7d8122808d42f9fdb7019061dc2e78a78efa (patch)
tree02b87073518f8f054e7275e73b6c55d771e4928b /Modules/gcmodule.c
parente9e2fd75ccbc6e9a5221cf3525e39e9d042d843f (diff)
downloadcpython-git-0c1e7d8122808d42f9fdb7019061dc2e78a78efa.tar.gz
bpo-33583: Add note in PyObject_GC_Resize() doc (GH-7021)
(cherry picked from commit 1179f4b40f375af5c59cd4b6be9cc313fa0e1a37) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r--Modules/gcmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 754348e20a..0b057ddbf5 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -1773,6 +1773,7 @@ _PyObject_GC_Resize(PyVarObject *op, Py_ssize_t nitems)
{
const size_t basicsize = _PyObject_VAR_SIZE(Py_TYPE(op), nitems);
PyGC_Head *g = AS_GC(op);
+ assert(!IS_TRACKED(op));
if (basicsize > PY_SSIZE_T_MAX - sizeof(PyGC_Head))
return (PyVarObject *)PyErr_NoMemory();
g = (PyGC_Head *)PyObject_REALLOC(g, sizeof(PyGC_Head) + basicsize);