This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients amaury.forgeotdarc, vstinner
Date 2013-08-29.19:51:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1377805878.21.0.928319634969.issue18874@psf.upfronthosting.co.za>
In-reply-to
Content
> Is it really impossible to use a standard Python dict instead of cfuhash?

I don't know if it is possible or not, I didn't try. Using PyDict has many requirements:

* the GIL must be held: I plan to hook also PyMem_Raw (which is called without the GIL being held)
* PyDict uses PyMem_Malloc() which would be a reentrant call
* the API uses PyObject* whereas tracemalloc uses C types and C structures
* PyDict can raises Python exceptions, which is not something expected from a memory allocator (especially PyMem_Malloc)
* etc.

The implementation is not done yet. I would like to be able to compute the size of memory allocated by the _tracemalloc module: size of hash tables.
History
Date User Action Args
2013-08-29 19:51:18vstinnersetrecipients: + vstinner, amaury.forgeotdarc
2013-08-29 19:51:18vstinnersetmessageid: <1377805878.21.0.928319634969.issue18874@psf.upfronthosting.co.za>
2013-08-29 19:51:18vstinnerlinkissue18874 messages
2013-08-29 19:51:17vstinnercreate