Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into gh-117511-pymutex
  • Loading branch information
colesbury committed Jun 17, 2024
commit 4ebc5e512b604ca77669fce2a56e023706521d9b
55 changes: 55 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2161,11 +2161,66 @@ New Features
* Add :c:func:`PyType_GetModuleByDef` to the limited C API
(Contributed by Victor Stinner in :gh:`116936`.)

* Add two new functions to the C-API, :c:func:`PyRefTracer_SetTracer` and
:c:func:`PyRefTracer_GetTracer`, that allows to track object creation and
destruction the same way the :mod:`tracemalloc` module does. (Contributed
by Pablo Galindo in :gh:`93502`.)

* Add :c:func:`PyEval_GetFrameBuiltins`, :c:func:`PyEval_GetFrameGlobals`, and
:c:func:`PyEval_GetFrameLocals` to the C API. These replacements for
:c:func:`PyEval_GetBuiltins`, :c:func:`PyEval_GetGlobals`, and
:c:func:`PyEval_GetLocals` return :term:`strong references <strong reference>`
rather than borrowed references. (Added as part of :pep:`667`.)

* Add :c:type:`PyMutex` API, a lightweight mutex that occupies a single byte.
The :c:func:`PyMutex_Lock` function will release the GIL (if currently held)
if the operation needs to block.
(Contributed by Sam Gross in :gh:`108724`.)

Build Changes
=============

* The :file:`configure` option :option:`--with-system-libmpdec` now defaults
to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python
3.15.

* Autoconf 2.71 and aclocal 1.16.4 are now required to regenerate
the :file:`configure` script.
(Contributed by Christian Heimes in :gh:`89886`.)

* SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension module.
(Contributed by Erlend Aasland in :gh:`105875`.)

* Python built with :file:`configure` :option:`--with-trace-refs` (tracing
references) is now ABI compatible with the Python release build and
:ref:`debug build <debug-build>`.
(Contributed by Victor Stinner in :gh:`108634`.)

* Building CPython now requires a compiler with support for the C11 atomic
library, GCC built-in atomic functions, or MSVC interlocked intrinsics.

* The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``,
``termios``, ``winsound``,
``_ctypes_test``, ``_multiprocessing.posixshmem``, ``_scproxy``, ``_stat``,
``_statistics``, ``_testconsole``, ``_testimportmultiple`` and ``_uuid``
C extensions are now built with the :ref:`limited C API <limited-c-api>`.
(Contributed by Victor Stinner in :gh:`85283`.)

* ``wasm32-wasi`` is now a :pep:`11` tier 2 platform.
(Contributed by Brett Cannon in :gh:`115192`.)

* ``wasm32-emscripten`` is no longer a :pep:`11` supported platform.
(Contributed by Brett Cannon in :gh:`115192`.)

* Python now bundles the `mimalloc library <https://github.com/microsoft/mimalloc>`__.
It is licensed under the MIT license; see :ref:`mimalloc license <mimalloc-license>`.
The bundled mimalloc has custom changes, see :gh:`113141` for details.
(Contributed by Dino Viehland in :gh:`109914`.)

* On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI
flags. For example, the free-threaded build generates ``python-3.13t.pc``
and the debug build generates ``python-3.13d.pc``.


Porting to Python 3.13
======================
Expand Down
14 changes: 0 additions & 14 deletions Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,6 @@ struct _object {
// fields have been merged.
#define _Py_UNOWNED_TID 0

// The shared reference count uses the two least-significant bits to store
// flags. The remaining bits are used to store the reference count.
#define _Py_REF_SHARED_SHIFT 2
#define _Py_REF_SHARED_FLAG_MASK 0x3

// The shared flags are initialized to zero.
#define _Py_REF_SHARED_INIT 0x0
#define _Py_REF_MAYBE_WEAKREF 0x1
#define _Py_REF_QUEUED 0x2
#define _Py_REF_MERGED 0x3

// Create a shared field from a refcnt and desired flags
#define _Py_REF_SHARED(refcnt, flags) (((refcnt) << _Py_REF_SHARED_SHIFT) + (flags))

struct _object {
// ob_tid stores the thread id (or zero). It is also used by the GC and the
// trashcan mechanism as a linked list pointer and by the GC to store the
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.