[issue26530] tracemalloc: add C API to manually track/untrack memory allocations

STINNER Victor report at bugs.python.org
Thu Mar 10 09:17:10 EST 2016


New submission from STINNER Victor:

The API of Python memory allocators was extended for numpy: calloc() was added (issue #21233). It looks like it's not enough because allocations with an alignment is also required for vector operations (SIMD). For Python, there is the issue #18835 but the benefit for Python code is unclear or negligible.

Instead of extending the API each time, it would be simpler to add an API to allow third party memory allocators to track/untrack memory in tracemalloc. I guess that the API should make the assumption that the GIL is not hold and so try to acquire the GIL (if it's not already hold).

Related numpy issue: https://github.com/numpy/numpy/issues/4663

See also: https://mail.scipy.org/pipermail/numpy-discussion/2015-January/072068.html

----------
messages: 261501
nosy: haypo, njs
priority: normal
severity: normal
status: open
title: tracemalloc: add C API to manually track/untrack memory allocations
type: enhancement
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26530>
_______________________________________


More information about the Python-bugs-list mailing list