summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* gh-104530: Enable native Win32 condition variables by default (GH-104531)Andrew Rogers2024-02-021-5/+5
|
* gh-114329: Add `PyList_GetItemRef` function (GH-114504)Sam Gross2024-02-021-0/+1
| | | | | | | The new `PyList_GetItemRef` is similar to `PyList_GetItem`, but returns a strong reference instead of a borrowed reference. Additionally, if the passed "list" object is not a list, the function sets a `TypeError` instead of calling `PyErr_BadInternalCall()`.
* GH-113710: Add a "globals to constants" pass (GH-114592)Mark Shannon2024-02-028-9/+32
| | | Converts specializations of `LOAD_GLOBAL` into constants during tier 2 optimization.
* GH-113655 Lower C recursion limit from 4000 to 3000 on Windows. (GH-114896)Mark Shannon2024-02-021-1/+1
|
* gh-111968: Use per-thread freelists for dict in free-threading (gh-114323)Donghee Na2024-02-015-22/+17
|
* gh-112529: Remove PyGC_Head from object pre-header in free-threaded build ↵Sam Gross2024-02-012-11/+21
| | | | | | | | | | | | | | | | | (#114564) * gh-112529: Remove PyGC_Head from object pre-header in free-threaded build This avoids allocating space for PyGC_Head in the free-threaded build. The GC implementation for free-threaded CPython does not use the PyGC_Head structure. * The trashcan mechanism uses the `ob_tid` field instead of `_gc_prev` in the free-threaded build. * The GDB libpython.py file now determines the offset of the managed dict field based on whether the running process is a free-threaded build. Those are identified by the `ob_ref_local` field in PyObject. * Fixes `_PySys_GetSizeOf()` which incorrectly incorrectly included the size of `PyGC_Head` in the size of static `PyTypeObject`.
* Fix comment in pycore_runtime.h (GH-110540)He Weidong2024-02-011-1/+1
|
* gh-112087: Make PyList_{Append,Size,GetSlice} to be thread-safe (gh-114651)Donghee Na2024-01-312-1/+6
|
* gh-113744: Add a new IncompleteInputError exception to improve incomplete ↵Pablo Galindo Salgado2024-01-301-0/+1
| | | | | input detection in the codeop module (#113745) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
* gh-112919: Speed-up datetime, date and time.replace() (GH-112921)Eugene Toder2024-01-304-0/+48
| | | | | Use argument clinic and call new_* functions directly. This speeds up these functions 6x to 7.5x when calling with keyword arguments.
* gh-112075: Dictionary global version counter should use atomic increments ↵Dino Viehland2024-01-291-0/+6
| | | | | (#114568) Dictionary global version counter should use atomic increments
* gh-112050: Adapt collections.deque to Argument Clinic (#113963)mpage2024-01-294-0/+6
|
* GH-113464: Add a JIT backend for tier 2 (GH-113465)Brandt Bucher2024-01-293-2/+29
| | | | | | | Add an option (--enable-experimental-jit for configure-based builds or --experimental-jit for PCbuild-based ones) to build an *experimental* just-in-time compiler, based on copy-and-patch (https://fredrikbk.com/publications/copy-and-patch.pdf). See Tools/jit/README.md for more information on how to install the required build-time tooling.
* gh-113055: Use pointer for interp->obmalloc state (gh-113412)Neil Schemenauer2024-01-274-9/+13
| | | | | | | | | For interpreters that share state with the main interpreter, this points to the same static memory structure. For interpreters with their own obmalloc state, it is heap allocated. Add free_obmalloc_arenas() which will free the obmalloc arenas and radix tree structures for interpreters with their own obmalloc state. Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-112087: Make list_repr and list_length to be thread-safe (gh-114582)Donghee Na2024-01-261-0/+4
|
* gh-111968: Unify freelist naming schema to Eric's suggestion (gh-114581)Donghee Na2024-01-261-7/+7
|
* gh-112529: Implement GC for free-threaded builds (#114262)Sam Gross2024-01-255-10/+131
| | | | | | | * gh-112529: Implement GC for free-threaded builds This implements a mark and sweep GC for the free-threaded builds of CPython. The implementation relies on mimalloc to find GC tracked objects (i.e., "containers").
* gh-112075: Add try-incref functions from nogil branch for use in dict thread ↵Dino Viehland2024-01-251-0/+136
| | | | | | | | | | | | | | | | | | | | safety (#114512) * Bring in a subset of biased reference counting: https://github.com/colesbury/nogil/commit/b6b12a9a94e The NoGIL branch has functions for attempting to do an incref on an object which may or may not be in flight. This just brings those functions over so that they will be usable from in the dict implementation to get items w/o holding a lock. There's a handful of small simple modifications: Adding inline to the force inline functions to avoid a warning, and switching from _Py_ALWAYS_INLINE to Py_ALWAYS_INLINE as that's available Remove _Py_REF_LOCAL_SHIFT as it doesn't exist yet (and is currently 0 in the 3.12 nogil branch anyway) ob_ref_shared is currently Py_ssize_t and not uint32_t, so use that _PY_LIKELY doesn't exist, so drop it _Py_ThreadLocal becomes _Py_IsOwnedByCurrentThread Add '_PyInterpreterState_GET()' to _Py_IncRefTotal calls. Co-Authored-By: Sam Gross <colesbury@gmail.com>
* gh-114312: Collect stats for unlikely events (GH-114493)Michael Droettboom2024-01-253-0/+45
|
* GH-112354: `END_FOR` instruction to only pop one value. (GH-114247)Mark Shannon2024-01-245-3/+39
| | | | * Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.
* GH-113710: Add a tier 2 peephole optimization pass. (GH-114487)Mark Shannon2024-01-242-3/+6
| | | | | * Convert _LOAD_CONST to inline versions * Remove PEP 523 checks
* GH-114456: lower the recursion limit under WASI for debug builds (GH-114457)Brett Cannon2024-01-231-4/+7
| | | Testing under wasmtime 16.0.0 w/ code from https://github.com/python/cpython/issues/114413 is how the value was found.
* gh-111964: Implement stop-the-world pauses (gh-112471)Sam Gross2024-01-238-15/+72
| | | | | | | | | | | | | | | | | The `--disable-gil` builds occasionally need to pause all but one thread. Some examples include: * Cyclic garbage collection, where this is often called a "stop the world event" * Before calling `fork()`, to ensure a consistent state for internal data structures * During interpreter shutdown, to ensure that daemon threads aren't accessing Python objects This adds the following functions to implement global and per-interpreter pauses: * `_PyEval_StopTheWorldAll()` and `_PyEval_StartTheWorldAll()` (for the global runtime) * `_PyEval_StopTheWorld()` and `_PyEval_StartTheWorld()` (per-interpreter) (The function names may change.) These functions are no-ops outside of the `--disable-gil` build.
* gh-112532: Improve mimalloc page visiting (#114133)Sam Gross2024-01-221-0/+4
| | | | | | | | | | | | | | | This adds support for visiting abandoned pages in mimalloc and improves the performance of the page visiting code. Abandoned pages contain memory blocks from threads that have exited. At some point, they may be later reclaimed by other threads. We still need to visit those pages in the free-threaded GC because they contain live objects. This also reduces the overhead of visiting mimalloc pages: * Special cases for full, empty, and pages containing only a single block. * Fix free_map to use one bit instead of one byte per block. * Use fast integer division by a constant algorithm when computing block offset from block size and index.
* gh-112529: Use GC heaps for GC allocations in free-threaded builds (gh-114157)Sam Gross2024-01-201-0/+71
| | | | | | | | | | * gh-112529: Use GC heaps for GC allocations in free-threaded builds The free-threaded build's garbage collector implementation will need to find GC objects by traversing mimalloc heaps. This hooks up the allocation calls with the correct heaps by using a thread-local "current_obj_heap" variable. * Refactor out setting heap based on type
* gh-111968: Use per-thread freelists for generator in free-threading (gh-114189)Donghee Na2024-01-184-30/+21
|
* Post 3.13.0a3Thomas Wouters2024-01-171-1/+1
|
* Python 3.13.0a3v3.13.0a3Thomas Wouters2024-01-171-2/+2
|
* gh-112529: Track if debug allocator is used as underlying allocator (#113747)Sam Gross2024-01-163-0/+6
| | | | | | | | | | | | | | | * gh-112529: Track if debug allocator is used as underlying allocator The GC implementation for free-threaded builds will need to accurately detect if the debug allocator is used because it affects the offset of the Python object from the beginning of the memory allocation. The current implementation of `_PyMem_DebugEnabled` only considers if the debug allocator is the outer-most allocator; it doesn't handle the case of "hooks" like tracemalloc being used on top of the debug allocator. This change enables more accurate detection of the debug allocator by tracking when debug hooks are enabled. * Simplify _PyMem_DebugEnabled
* gh-111968: Use per-thread freelists for PyContext in free-threading (gh-114122)Donghee Na2024-01-164-20/+14
|
* gh-113626: Add allow_code parameter in marshal functions (GH-113648)Serhiy Storchaka2024-01-164-0/+6
| | | | | Passing allow_code=False prevents serialization and de-serialization of code objects which is incompatible between Python versions.
* GH-113655: Lower the C recursion limit on various platforms (GH-113944)Mark Shannon2024-01-161-2/+6
|
* gh-111968: Use per-thread slice_cache in free-threading (gh-113972)Donghee Na2024-01-154-4/+11
|
* GH-112354: `_GUARD_IS_TRUE_POP` side-exits to target the next instruction, ↵Mark Shannon2024-01-151-1/+1
| | | | not themselves. (GH-114078)
* Fix a grammatical error in `pycore_pymem.h` (#112993)Joseph Pearson2024-01-121-1/+1
|
* gh-113710: Add types to the interpreter DSL (#113711)Ken Jin2024-01-123-55/+56
| | | | Co-authored-by: Jules <57632293+JuliaPoo@users.noreply.github.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* GH-113860: Get rid of `_PyUOpExecutorObject` (GH-113954)Brandt Bucher2024-01-123-33/+8
|
* gh-111968: Use per-thread freelists for tuple in free-threading (gh-113921)Donghee Na2024-01-113-45/+28
|
* GH-113853: Guarantee forward progress in executors (GH-113854)Mark Shannon2024-01-111-1/+1
|
* gh-112640: Add `kwdefaults` parameter to `types.FunctionType.__new__` (#112641)Nikita Sobolev2024-01-114-0/+6
|
* gh-111968: Unify naming scheme for freelist (gh-113919)Donghee Na2024-01-101-1/+1
|
* gh-113753: Clear finalized bit when putting PyAsyncGenASend back into free ↵Sam Gross2024-01-101-0/+4
| | | | list (#113754)
* gh-111968: Use per-thread freelists for float in free-threading (gh-113886)Donghee Na2024-01-104-29/+21
|
* GH-113860: All executors are now defined in terms of micro ops. Convert ↵Mark Shannon2024-01-105-9/+14
| | | | counter executor to use uops. (GH-113864)
* gh-111968: Introduce _PyFreeListState and _PyFreeListState_GET API (gh-113584)Donghee Na2024-01-096-22/+63
|
* gh-110721: Remove unused code from suggestions.c after moving PyErr_Display ↵Pablo Galindo Salgado2024-01-084-6/+0
| | | | to use the traceback module (#113712)
* gh-113750: Fix object resurrection in free-threaded builds (gh-113751)Sam Gross2024-01-061-0/+1
| | | | | | | | | gh-113750: Fix object resurrection on free-threaded builds This avoids the undesired re-initializing of fields like `ob_gc_bits`, `ob_mutex`, and `ob_tid` when an object is resurrected due to its finalizer being called. This change has no effect on the default (with GIL) build.
* gh-113688: Split up gcmodule.c (gh-113715)Sam Gross2024-01-051-0/+31
| | | | | This splits part of Modules/gcmodule.c of into Python/gc.c, which now contains the core garbage collection implementation. The Python module remain in the Modules/gcmodule.c file.
* gh-112532: Tag mimalloc heaps and pages (#113742)Sam Gross2024-01-052-1/+3
| | | | | | | | | | | | | | | | | | | | | * gh-112532: Tag mimalloc heaps and pages Mimalloc pages are data structures that contain contiguous allocations of the same block size. Note that they are distinct from operating system pages. Mimalloc pages are contained in segments. When a thread exits, it abandons any segments and contained pages that have live allocations. These segments and pages may be later reclaimed by another thread. To support GC and certain thread-safety guarantees in free-threaded builds, we want pages to only be reclaimed by the corresponding heap in the claimant thread. For example, we want pages containing GC objects to only be claimed by GC heaps. This allows heaps and pages to be tagged with an integer tag that is used to ensure that abandoned pages are only claimed by heaps with the same tag. Heaps can be initialized with a tag (0-15); any page allocated by that heap copies the corresponding tag. * Fix conversion warning
* GH-113486: Do not emit spurious PY_UNWIND events for optimized calls to ↵Mark Shannon2024-01-051-0/+2
| | | | classes. (GH-113680)