bpo-37448: Use radix tree for pymalloc address_in_range(). (GH-14474) · python/cpython@85b6b70

File tree

2 files changed

lines changed

  • Misc/NEWS.d/next/Core and Builtins

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,15 @@

1+

Add a radix tree based memory map to track in-use obmalloc arenas. Use to

2+

replace the old implementation of address_in_range(). The radix tree

3+

approach makes it easy to increase pool sizes beyond the OS page size.

4+

Boosting the pool and arena size allows obmalloc to handle a significantly

5+

higher percentage of requests from its ultra-fast paths.

6+
7+

It also has the advantage of eliminating the memory unsanitary behavior of

8+

the previous address_in_range(). The old address_in_range() was marked with

9+

the annotations _Py_NO_SANITIZE_ADDRESS, _Py_NO_SANITIZE_THREAD, and

10+

_Py_NO_SANITIZE_MEMORY. Those annotations are no longer needed.

11+
12+

To disable the radix tree map, set a preprocessor flag as follows:

13+

`-DWITH_PYMALLOC_RADIX_TREE=0`.

14+
15+

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