Message225319
The code is missing an overflow check. There should be some verification that __sizeof__ returns a value smaller than SIZE_T_MAX - 24. Also 24 for GC overhead looks strange. IMHO it should be sizeof(PyGC_Head) which can be smaller than 24 bytes.
Python 3.5.0a0 (default:601045ceff94, Aug 14 2014, 22:59:49)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class Overflow:
... def __sizeof__(self):
... return (1<<64)-1
...
>>> sys.getsizeof(Overflow())
23 |
|
Date |
User |
Action |
Args |
2014-08-14 21:10:47 | christian.heimes | set | recipients:
+ christian.heimes, loewis, python-dev, serhiy.storchaka |
2014-08-14 21:10:47 | christian.heimes | set | messageid: <1408050647.75.0.926106918321.issue22193@psf.upfronthosting.co.za> |
2014-08-14 21:10:47 | christian.heimes | link | issue22193 messages |
2014-08-14 21:10:47 | christian.heimes | create | |
|