Skip to content

_tracemalloc: remove pointer_t type #84789

Description

@vstinner
BPO 40609
Nosy @vstinner
PRs
  • bpo-40609: Rewrite how _tracemalloc handles domains #20059
  • bpo-40609: Remove _Py_hashtable_t.key_size #20060
  • bpo-40609: Add destroy functions to _Py_hashtable #20062
  • bpo-40609: _tracemalloc allocates traces #20064
  • bpo-40609: _Py_hashtable_t values become void* #20065
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-05-14.01:12:44.737>
    created_at = <Date 2020-05-12.22:47:15.350>
    labels = ['library', '3.9']
    title = '_tracemalloc: remove pointer_t type'
    updated_at = <Date 2020-05-14.01:12:44.735>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-05-14.01:12:44.735>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-14.01:12:44.737>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2020-05-12.22:47:15.350>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40609
    keywords = ['patch']
    message_count = 7.0
    messages = ['368747', '368750', '368753', '368754', '368755', '368757', '368812']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['20059', '20060', '20062', '20064', '20065']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue40609'
    versions = ['Python 3.9']

    Activity

    1. vstinner commented on May 12, 2020

      @vstinner
      MemberAuthor

      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.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on May 12, 2020
    3. vstinner commented on May 12, 2020

      @vstinner
      MemberAuthor

      New changeset 9e2ca17 by Victor Stinner in branch 'master':
      bpo-40609: Rewrite how _tracemalloc handles domains (GH-20059)
      9e2ca17

    4. vstinner commented on May 13, 2020

      @vstinner
      MemberAuthor

      New changeset f9b3b58 by Victor Stinner in branch 'master':
      bpo-40609: Remove _Py_hashtable_t.key_size (GH-20060)
      f9b3b58

    5. vstinner commented on May 13, 2020

      @vstinner
      MemberAuthor

      New changeset 2d0a3d6 by Victor Stinner in branch 'master':
      bpo-40609: Add destroy functions to _Py_hashtable (GH-20062)
      2d0a3d6

    6. vstinner commented on May 13, 2020

      @vstinner
      MemberAuthor

      New changeset d95bd42 by Victor Stinner in branch 'master':
      bpo-40609: _tracemalloc allocates traces (GH-20064)
      d95bd42

    7. vstinner commented on May 13, 2020

      @vstinner
      MemberAuthor

      New changeset 5b0a303 by Victor Stinner in branch 'master':
      bpo-40609: _Py_hashtable_t values become void* (GH-20065)
      5b0a303

    8. vstinner commented on May 14, 2020

      @vstinner
      MemberAuthor

      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.

    9. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directory

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions