STINNER Victor added the comment: > 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18874> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com