Author haypo
Recipients haypo, njs, pitrou
Date 2016-03-18.21:39:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za>
In-reply-to
Content
The tracemalloc module uses a hashtable: pointer (void*) => trace. Some embedded devices use multiple address spaces. Each GPU also has its own address space. CUDA, OpenCL and OpenGL should also be seen as different address spaces.

In the issue #26530, it was proposed (required?) to support multiple addresses spaces to be able to use tracemalloc in numpy.

Attached patch enhances tracemalloc to use (pointer: void*, domain: unsigned int) as key in the hashtable. A (pointer, domain) key is stored in a hashtable entry.

In the patch, the domain is hardcoded to 0, but the issue #26530 will add new C functions to track/untrack memory blocks, and this new functions will have a domain parameter.

The patch changes how a key is passed to the hashtable API: pass a *pointer* to a key rather than directly the key value. Because of that, the patch is quite long.

The patch also removes the unused function _Py_hashtable_hash_int().

_Py_HASHTABLE_ENTRY_DATA() macro now requires the hashtable to get the key size, since the offset of data now depends on the key size.
History
Date User Action Args
2016-03-18 21:39:28hayposetrecipients: + haypo, pitrou, njs
2016-03-18 21:39:27hayposetmessageid: <1458337167.06.0.908004959718.issue26588@psf.upfronthosting.co.za>
2016-03-18 21:39:26haypolinkissue26588 messages
2016-03-18 21:39:26haypocreate