Message281916
It seems to me, that all builtin and extension types set tp_free to PyObject_Del, PyObject_GC_Del, or 0. The int class is the only exception.
int_free() was introduced in 200559fcc664:
> Make sure that tp_free frees the int the same way as tp_dealloc would.
> This fixes the problem that Barry reported on python-dev:
> >>> 23000 .__class__ = bool
> crashes in the deallocator. This was because int inherited tp_free
> from object, which uses the default allocator.
The above example no longer works:
>>> 23000 .__class__ = bool
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __class__ assignment: only for heap types
I think int_free should be removed and tp_free should be reverted to 0 (as in float type). |
|
Date |
User |
Action |
Args |
2016-11-28 21:15:12 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, barry, scoder |
2016-11-28 21:15:12 | serhiy.storchaka | set | messageid: <1480367712.46.0.392832051675.issue24469@psf.upfronthosting.co.za> |
2016-11-28 21:15:12 | serhiy.storchaka | link | issue24469 messages |
2016-11-28 21:15:12 | serhiy.storchaka | create | |
|