bpo-37448: Add radix tree implementation for obmalloc address_in_range(). by nascheme · Pull Request #14474 · python/cpython

tim-one

tim-one

tim-one

The radix tree approach is a relatively simple and memory sanitary
alternative to the current (slightly) unsanitary address_in_range().
The radix tree is currently only implemented for 64-bit platforms.
Adding a 32-bit version would be relatively easy.

@nascheme

@nascheme

@nascheme

@nascheme

Current 64-bit chips only have 48 bits of physical addresses.
Exploit that to further shrink the size of the radix tree.

@nascheme

@nascheme

@nascheme

@nascheme

@nascheme

@nascheme

@nascheme

@nascheme

If disabled, the old version of address_in_range() is used.

@nascheme

@nascheme

@nascheme

pablogsal

jrtc27

methane

diegorusso pushed a commit to diegorusso/cpython that referenced this pull request

Jan 5, 2024
…n_range(). (pythonGH-14474)

This is a backport of the radix tree implementation for pymalloc.
It is not platform specific but it solves a segmentation fault on
aarch64 platforms when MTE (Memory Tag Extension) is enabled.
The github issue is pythongh-87759.

Original commit message:
The radix tree approach is a relatively simple and memory sanitary
alternative to the old (slightly) unsanitary address_in_range().
To disable the radix tree map, set a preprocessor flag as follows:
-DWITH_PYMALLOC_RADIX_TREE=0.

(cherry picked from commit 85b6b70)

Co-authored-by: Tim Peters <tim.peters@gmail.com>
Jira: ENTLLT-7122
Change-Id: Ifbc8c1290077b78c85ac30abe0bcbb7c8ea0b959

diegorusso pushed a commit to diegorusso/cpython that referenced this pull request

Jan 5, 2024
…n_range(). (pythonGH-14474)

This is a backport of the radix tree implementation for pymalloc.
It is not platform specific but it solves a segmentation fault on
aarch64 platforms when MTE (Memory Tag Extension) is enabled.
The github issue is pythongh-87759.

Original commit message:
The radix tree approach is a relatively simple and memory sanitary
alternative to the old (slightly) unsanitary address_in_range().
To disable the radix tree map, set a preprocessor flag as follows:
-DWITH_PYMALLOC_RADIX_TREE=0.

(cherry picked from commit 85b6b70)

Co-authored-by: Tim Peters <tim.peters@gmail.com>
Change-Id: I0a3c2979c207f997c707c5f798941426c8d50004