summaryrefslogtreecommitdiffstats
path: root/Objects/obmalloc.c
diff options
context:
space:
mode:
authorNeil Schemenauer <nas-github@arctrix.com>2021-10-21 13:38:36 (GMT)
committerGitHub <noreply@github.com>2021-10-21 13:38:36 (GMT)
commit311910b31a4bd94dc79298388b7cb65ca5546438 (patch)
tree233dded5ff6cd6899c0524e44a29a8059e8ff776 /Objects/obmalloc.c
parent9942f42a93ccda047fd3558c47b822e99afe10c0 (diff)
downloadcpython-311910b31a4bd94dc79298388b7cb65ca5546438.zip
cpython-311910b31a4bd94dc79298388b7cb65ca5546438.tar.gz
cpython-311910b31a4bd94dc79298388b7cb65ca5546438.tar.bz2
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.
Diffstat (limited to 'Objects/obmalloc.c')
-rw-r--r--Objects/obmalloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index d8d6f6d..2eddb2c 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -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)