Message299700
There is an existing protocol for estimating the size of allocated memory. __sizeof__. Python API sys.getsizeof() and C API _PySys_GetSizeOf(). But it is too heavy for using in GC.
As a fast approximation the default implementation of the __sizeof__ method can be used:
tp_basicsize + tp_itemsize * Py_SIZE(self) |
|
Date |
User |
Action |
Args |
2017-08-03 12:14:51 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, arigo, pitrou |
2017-08-03 12:14:51 | serhiy.storchaka | set | messageid: <1501762491.94.0.0780356045867.issue31105@psf.upfronthosting.co.za> |
2017-08-03 12:14:51 | serhiy.storchaka | link | issue31105 messages |
2017-08-03 12:14:51 | serhiy.storchaka | create | |
|