cpython/Objects
Pablo Galindo Salgado 96e4cd698a
gh-144319: Fix huge page safety in pymalloc arenas (#144331)
The pymalloc huge page support had two problems. First, on
architectures where the default huge page size exceeds the arena
size (e.g. 32 MiB on PPC, 512 MiB on ARM64 with 64 KB base
pages), mmap with MAP_HUGETLB silently allocates a full huge page
even when the requested size is smaller. The subsequent munmap
with the original arena size then fails with EINVAL, permanently
leaking the entire huge page. Second, huge pages were always
attempted when compiled in, with no way to disable them at
runtime. On Linux, if the huge page pool is exhausted, page
faults including copy-on-write faults after fork deliver SIGBUS
and kill the process.

The arena allocator now queries the system huge page size from
/proc/meminfo and skips MAP_HUGETLB when the arena size is not a
multiple of it. Huge pages also now require explicit opt-in at
runtime via the PYTHON_PYMALLOC_HUGEPAGES environment variable,
which is read through PyConfig and respects -E and -I flags.
The config field pymalloc_hugepages is propagated to the runtime
allocators struct so the low-level arena allocator can check it
without calling getenv directly.
2026-01-30 18:18:56 +00:00
..
clinic gh-129068: Make range iterators thread-safe (gh-142886) 2025-12-18 13:11:51 -05:00
mimalloc gh-123826: Fix unused function warnings in mimalloc on NetBSD (#123827) 2024-09-09 13:22:28 -04:00
stringlib gh-139353: Rename formatter_unicode.c to unicode_formatter.c (#139723) 2025-10-08 14:56:00 +02:00
abstract.c GH-139922: Tail calling for MSVC (VS 2026) (GH-143068) 2025-12-22 23:01:34 +00:00
boolobject.c gh-111178: remove redundant casts for functions with correct signatures (#131673) 2025-04-01 17:18:11 +02:00
bytearrayobject.c gh-143003: Fix possible shared buffer overflow in bytearray.extend() (GH-143086) 2025-12-28 12:30:36 +00:00
bytes_methods.c gh-129813, PEP 782: Use PyBytesWriter in _Py_bytes_maketrans() (#139044) 2025-09-17 17:43:30 +02:00
bytesobject.c gh-142037: Fix a refleak introduced in GH-142081 (GH-144256) 2026-01-26 21:15:21 +00:00
call.c gh-142737: Handle lost io.open in _Py_FindSourceFile (GH-142747) 2025-12-15 22:58:50 +00:00
capsule.c gh-111178: fix UBSan failures in Objects/capsule.c (GH-128239) 2025-01-08 14:55:04 +01:00
cellobject.c gh-127271: Replace use of PyCell_GET/SET (gh-127272) 2024-12-03 10:33:06 -08:00
classobject.c gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) 2025-06-30 11:14:31 +00:00
codeobject.c gh-141504: Refactor policy object into a single opt_config (gh-143644) 2026-01-15 09:53:00 +09:00
complexobject.c gh-141004: soft-deprecate Py_INFINITY macro (#141033) 2025-11-12 13:44:49 +01:00
descrobject.c gh-111489: Remove _PyTuple_FromArray() alias (#139973) 2025-10-11 22:58:14 +02:00
dictnotes.txt bpo-46845: Reduce dict size when all keys are Unicode (GH-31564) 2022-03-02 08:09:28 +09:00
dictobject.c gh-144295: Fix data race in dict method lookup and global load (gh-144312) 2026-01-30 11:14:10 -05:00
enumobject.c gh-137609: Change names of some positional-only parameters in builtins (GH-137611) 2025-08-25 15:36:06 +03:00
exceptions.c gh-129824: Fix data race in _PyBuiltins_AddExceptions with subinterpreters (gh-143446) 2026-01-06 09:15:55 -05:00
fileobject.c gh-130821: Add type information to error messages for invalid return type (GH-130835) 2025-08-14 11:04:41 +03:00
floatobject.c gh-143006: Fix and optimize mixed comparison of float and int (GH-143084) 2026-01-09 19:06:45 +02:00
frameobject.c gh-120321: Make gen.gi_frame.clear() thread-safe (gh-143112) 2026-01-08 14:45:54 -05:00
funcobject.c gh-139109: A new tracing JIT compiler frontend for CPython (GH-140310) 2025-11-13 18:08:32 +00:00
genericaliasobject.c gh-143635: Fix crash in ga_repr_items_list (#143670) 2026-01-15 06:50:47 +03:00
genobject.c gh-120321: Make gi_yieldfrom thread-safe in free-threading build (#144292) 2026-01-30 12:20:27 -05:00
interpolationobject.c gh-132661: Add default value (of "") for Interpolation.expression (#136441) 2025-07-10 16:27:41 +02:00
iterobject.c gh-130821: Add type information to error messages for invalid return type (GH-130835) 2025-08-14 11:04:41 +03:00
listobject.c gh-129069: fix more thread safety issues in list (#143019) 2025-12-22 21:45:28 +05:30
listsort.txt gh-135551: Change how sorting picks minimum run length (#135553) 2025-06-26 23:48:05 -05:00
lnotab_notes.txt gh-119786: add code object doc, inline locations.md into it (#126832) 2024-11-22 19:27:41 +00:00
longobject.c gh-143192 Avoid incref/decref pair in long_bitwise (gh-143194) 2026-01-29 16:32:09 -05:00
memoryobject.c gh-142664: fix PyObject_Hash invokation post GH-143217 (#143223) 2025-12-27 14:30:09 +00:00
methodobject.c gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) 2025-06-30 11:14:31 +00:00
moduleobject.c gh-141780: Make PyModule_FromSlotsAndSpec enable GIL if needed (GH-141785) 2025-11-24 13:26:35 +01:00
namespaceobject.c gh-136193: Improve TypeError msg when comparing two SimpleNamespaces (#136195) 2025-07-02 14:32:41 +03:00
object.c gh-102809: No longer mention Misc/gdbinit in the code (#143980) 2026-01-19 18:36:55 +01:00
object_layout.md GH-115776: Allow any fixed sized object to have inline values (GH-123192) 2024-08-21 15:52:04 +01:00
object_layout_312.gv GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
object_layout_312.png gh-71648: Optimize PNG files (GH-138842) 2025-09-12 20:13:05 +00:00
object_layout_313.gv GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
object_layout_313.png gh-71648: Optimize PNG files (GH-138842) 2025-09-12 20:13:05 +00:00
object_layout_full_312.gv GH-96068: Document object layout (GH-96069) 2022-08-23 13:55:43 +01:00
object_layout_full_312.png gh-71648: Optimize PNG files (GH-138842) 2025-09-12 20:13:05 +00:00
object_layout_full_313.gv GH-115776: Embed the values array into the object, for "normal" Python objects. (GH-116115) 2024-04-02 11:59:21 +01:00
object_layout_full_313.png gh-71648: Optimize PNG files (GH-138842) 2025-09-12 20:13:05 +00:00
obmalloc.c gh-144319: Fix huge page safety in pymalloc arenas (#144331) 2026-01-30 18:18:56 +00:00
odictobject.c gh-142217: Remove internal _Py_Identifier functions (#142219) 2025-12-03 14:33:32 +01:00
picklebufobject.c gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) 2025-06-30 11:14:31 +00:00
rangeobject.c gh-129068: Make range iterators thread-safe (gh-142886) 2025-12-18 13:11:51 -05:00
README
setobject.c gh-140232: Do not track frozenset objects with immutables (#140234) 2026-01-28 11:27:37 +01:00
sliceobject.c gh-142913: Add test case for interpreter generator w/ overridden opcodes (#142911) 2026-01-16 10:33:29 -08:00
structseq.c gh-111489: Remove _PyTuple_FromArray() alias (#139973) 2025-10-11 22:58:14 +02:00
templateobject.c gh-142433: Move deref to below the error when checking for laststring (#142402) 2025-12-10 16:41:52 +01:00
tupleobject.c GH-139951: Fix major GC performance regression (GH-140262) 2025-10-21 15:22:15 +01:00
typeobject.c Remove outdated comment about excess_args warning in object.__init__ (#143669) 2026-01-11 10:27:11 +03:00
typeslots.inc Revert "gh-133395: add option for extension modules to specialize BINARY_OP/SUBSCR, apply to arrays (#133396)" (#133498) 2025-05-06 13:12:26 +03:00
typeslots.py gh-124153: Implement PyType_GetBaseByToken() and Py_tp_token slot (GH-124163) 2024-09-18 09:18:19 +02:00
typevarobject.c gh-143089: Fix ParamSpec default examples to use list instead of tuple (#143179) 2026-01-07 19:32:44 -08:00
unicode_format.c gh-142037: Improve error messages for printf-style formatting (GH-142081) 2026-01-24 11:13:50 +00:00
unicode_formatter.c gh-139353: Rename formatter_unicode.c to unicode_formatter.c (#139723) 2025-10-08 14:56:00 +02:00
unicode_writer.c gh-139353: Add Objects/unicode_writer.c file (#139911) 2025-10-30 14:36:15 +01:00
unicodectype.c gh-129117: Add unicodedata.isxidstart() function (#140269) 2025-10-30 10:18:12 +00:00
unicodeobject.c gh-141070: Rename PyUnstable_Object_Dump to PyObject_Dump (GH-142848) 2026-01-16 09:19:43 -05:00
unicodetype_db.h closes gh-138706: update Unicode to 17.0.0 (#138719) 2025-09-11 09:58:39 -07:00
unionobject.c gh-140348: Fix using | on unusual objects plus Unions (#140383) 2025-11-03 06:50:37 -08:00
weakrefobject.c gh-133644: remove PyWeakref_GetObject and PyWeakref_GET_OBJECT (GH-133657) 2025-09-24 11:25:56 +02:00

Source files for various builtin objects