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

STINNER Victor report at bugs.python.org
Fri Mar 18 03:09:48 EDT 2016


STINNER Victor added the comment:

Instead of having to change the API for tracking GPU memory, I suggest to
try a hack. Memory allocations use an alignement. For pymalloc, it's 8
bytes for example. On a GPU I expect at least 2 bytes or more likey
something much bigger like 16 bytes. For malloc, I also expect at least 2
bytes.

If it's the minimum is 2 bytes, good. Use the lowest bit as a "GPU" flag!
pointer|1.

Tracemalloc doesn't give access to pointers in its API, so it shouldn't
matter.

----------

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


More information about the Python-bugs-list mailing list