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 <rep...@bugs.python.org>
<http://bugs.python.org/issue26530>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to