This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _tracemalloc: remove pointer_t type
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: patch

Created on 2020-05-12 22:47 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20059 merged vstinner, 2020-05-12 22:50
PR 20060 merged vstinner, 2020-05-12 23:48
PR 20062 merged vstinner, 2020-05-13 00:28
PR 20064 merged vstinner, 2020-05-13 01:01
PR 20065 merged vstinner, 2020-05-13 02:20
Messages (7)
msg368747 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-12 22:47
In bpo-26588, I modified the _tracemalloc module to support tracing memory allocations in multiple "domains" for numpy. I modified hashtable.c to support keys larger than void*, and I modified _tracemalloc.c to use a new pointer_t structure which is made of (domain: unsigned int, ptr: void*).

These changes made hashtable.c way more complicated than what it should be. I would like to reuse hashtable.c in more places. I am working on a change to remove the pointer_t type from _tracemalloc.c, and instead use a hash table for traces of domains other than the default domain (0). The new hash table maps a domain to a hash table: traces of a domain.

tracemalloc_traces remains the default hash table for traces of the default domain. Since it's the most common case, it doesn't go through the new hash table.
msg368750 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-12 23:37
New changeset 9e2ca1742076169089b818d0883688a2ddd9964a by Victor Stinner in branch 'master':
bpo-40609: Rewrite how _tracemalloc handles domains (GH-20059)
https://github.com/python/cpython/commit/9e2ca1742076169089b818d0883688a2ddd9964a
msg368753 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-13 00:26
New changeset f9b3b582b86b9cce8d69ec7d03d716ec81c8264a by Victor Stinner in branch 'master':
bpo-40609: Remove _Py_hashtable_t.key_size (GH-20060)
https://github.com/python/cpython/commit/f9b3b582b86b9cce8d69ec7d03d716ec81c8264a
msg368754 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-13 00:50
New changeset 2d0a3d682f699cce8db6e30981d41d9125318726 by Victor Stinner in branch 'master':
bpo-40609: Add destroy functions to _Py_hashtable (GH-20062)
https://github.com/python/cpython/commit/2d0a3d682f699cce8db6e30981d41d9125318726
msg368755 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-13 01:52
New changeset d95bd4214c2babe851b02562d973d60c02e639b7 by Victor Stinner in branch 'master':
bpo-40609: _tracemalloc allocates traces (GH-20064)
https://github.com/python/cpython/commit/d95bd4214c2babe851b02562d973d60c02e639b7
msg368757 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-13 02:40
New changeset 5b0a30354d8a8bb39a05ce10ca4f5c78b729f25b by Victor Stinner in branch 'master':
bpo-40609: _Py_hashtable_t values become void* (GH-20065)
https://github.com/python/cpython/commit/5b0a30354d8a8bb39a05ce10ca4f5c78b729f25b
msg368812 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-14 01:12
I modified _Py_hashtable_t to remove key_size and data_size: keys are now always "void *" and values are now always "void *".

See also bpo-40602: Move Modules/hashtable.h to Include/internal/pycore_hashtable.h.
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84789
2020-05-14 01:12:44vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg368812

stage: patch review -> resolved
2020-05-13 02:40:39vstinnersetmessages: + msg368757
2020-05-13 02:20:11vstinnersetpull_requests: + pull_request19374
2020-05-13 01:52:17vstinnersetmessages: + msg368755
2020-05-13 01:01:54vstinnersetpull_requests: + pull_request19373
2020-05-13 00:50:25vstinnersetmessages: + msg368754
2020-05-13 00:28:23vstinnersetpull_requests: + pull_request19371
2020-05-13 00:26:08vstinnersetmessages: + msg368753
2020-05-12 23:48:31vstinnersetpull_requests: + pull_request19368
2020-05-12 23:37:07vstinnersetmessages: + msg368750
2020-05-12 22:50:12vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request19367
2020-05-12 22:47:15vstinnercreate