bpo-45521: Fix a bug in the obmalloc radix tree code. (GH-29051)

MAP_BOT_LENGTH was incorrectly used to compute MAP_TOP_MASK instead of
MAP_TOP_LENGTH. On 64-bit machines, the error causes the tree to hold
46-bits of virtual addresses, rather than the intended 48-bits.
This commit is contained in:
Neil Schemenauer 2021-10-21 06:38:36 -07:00 committed by GitHub
parent 9942f42a93
commit 311910b31a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -1341,7 +1341,7 @@ _Py_GetAllocatedBlocks(void)
#define MAP_TOP_BITS INTERIOR_BITS
#define MAP_TOP_LENGTH (1 << MAP_TOP_BITS)
#define MAP_TOP_MASK (MAP_BOT_LENGTH - 1)
#define MAP_TOP_MASK (MAP_TOP_LENGTH - 1)
#define MAP_MID_BITS INTERIOR_BITS
#define MAP_MID_LENGTH (1 << MAP_MID_BITS)