Skip to content

Move Modules/hashtable.h to Include/internal/pycore_hashtable.h #84782

Description

@vstinner
BPO 40602
Nosy @vstinner
PRs
  • bpo-40602: Rename hashtable.h to pycore_hashtable.h #20044
  • bpo-40602: _Py_hashtable_new() uses PyMem_Malloc() #20046
  • bpo-40602: Optimize _Py_hashtable for pointer keys #20051
  • bpo-40602: Add _Py_HashPointerRaw() function #20056
  • bpo-40602: Optimize _Py_hashtable_get_ptr() #20066
  • bpo-40602: _Py_hashtable_set() reports rehash failure #20077
  • bpo-40602: Write unit tests for _Py_hashtable_t #20091
  • 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.20:52:38.500>
    created_at = <Date 2020-05-12.00:01:24.785>
    labels = ['expert-C-API', '3.9']
    title = 'Move Modules/hashtable.h to Include/internal/pycore_hashtable.h'
    updated_at = <Date 2020-05-14.20:52:38.499>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-05-14.20:52:38.499>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-14.20:52:38.500>
    closer = 'vstinner'
    components = ['C API']
    creation = <Date 2020-05-12.00:01:24.785>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40602
    keywords = ['patch']
    message_count = 9.0
    messages = ['368685', '368689', '368690', '368722', '368737', '368756', '368758', '368864', '368867']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['20044', '20046', '20051', '20056', '20066', '20077', '20091']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue40602'
    versions = ['Python 3.9']

    Activity

    1. vstinner commented on May 12, 2020

      @vstinner
      MemberAuthor

      Python/mashal.c uses Modules/hashtable.h.

      Python/mashal.c indirectly gets Modules/hashtable.c implementation via Modules/_tracemalloc.c which is built as a builtin module.

      I propose to make the "hashtable" more standard:

      Attached PR implements this change but also changes the default memory allocator to PyMem_Malloc/PyMem_Free which is faster than PyMem_RawMalloc/PyMem_RawFree (current default) for memory blocks <= 512 bytes.

      It remains an internal C API which cannot be used outside CPython.

    2. vstinner commented on May 12, 2020

      @vstinner
      MemberAuthor

      New changeset b617993 by Victor Stinner in branch 'master':
      bpo-40602: Rename hashtable.h to pycore_hashtable.h (GH-20044)
      b617993

    3. vstinner commented on May 12, 2020

      @vstinner
      MemberAuthor

      New changeset d0919f0 by Victor Stinner in branch 'master':
      bpo-40602: _Py_hashtable_new() uses PyMem_Malloc() (GH-20046)
      d0919f0

    4. vstinner commented on May 12, 2020

      @vstinner
      MemberAuthor

      New changeset 7c6e970 by Victor Stinner in branch 'master':
      bpo-40602: Optimize _Py_hashtable for pointer keys (GH-20051)
      7c6e970

    5. vstinner commented on May 12, 2020

      @vstinner
      MemberAuthor

      New changeset f453221 by Victor Stinner in branch 'master':
      bpo-40602: Add _Py_HashPointerRaw() function (GH-20056)
      f453221

    6. vstinner commented on May 13, 2020

      @vstinner
      MemberAuthor

      See also bpo-40609: "_tracemalloc: remove pointer_t type".

    7. vstinner commented on May 13, 2020

      @vstinner
      MemberAuthor

      New changeset 42bae3a by Victor Stinner in branch 'master':
      bpo-40602: Optimize _Py_hashtable_get_ptr() (GH-20066)
      42bae3a

    8. vstinner commented on May 14, 2020

      @vstinner
      MemberAuthor

      New changeset a482dc5 by Victor Stinner in branch 'master':
      bpo-40602: Write unit tests for _Py_hashtable_t (GH-20091)
      a482dc5

    9. vstinner commented on May 14, 2020

      @vstinner
      MemberAuthor

      New changeset d2dc827 by Victor Stinner in branch 'master':
      bpo-40602: _Py_hashtable_set() reports rehash failure (GH-20077)
      d2dc827

    10. 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

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions