Message317158
https://github.com/python/cpython/blob/master/Modules/gcmodule.c#L1750-L1763
PyObject_GC_Resize() calls PyObject_REALLOC(), which can change object's address.
But it doesn't relinking:
g->gc.gc_prev->gc.gc_next = g
g->gc.gc_next->gc.gc_prev = g
So this API can't be used for tracked object.
In CPython code, all callers use this API for non tracked objects.
But if some extension module author used this API for tracked objects, it will cause hard to debug behavior.
Which should we do?
1. Add relinking to PyObject_GC_Resize()
2. Add note in the document
If 1, should we backport it to 3.7 and 3.6? |
|
Date |
User |
Action |
Args |
2018-05-20 07:42:31 | methane | set | recipients:
+ methane |
2018-05-20 07:42:31 | methane | set | messageid: <1526802151.18.0.682650639539.issue33583@psf.upfronthosting.co.za> |
2018-05-20 07:42:31 | methane | link | issue33583 messages |
2018-05-20 07:42:30 | methane | create | |
|