summaryrefslogtreecommitdiffstats
path: root/Include/cpython/weakrefobject.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-111178: Fix function signatures in weakrefobject.c (#124903)Victor Stinner2024-10-021-5/+5
|
* gh-117511: Make PyMutex public in the non-limited API (#117731)Sam Gross2024-06-201-1/+1
|
* gh-118789: Restore hidden `_PyWeakref_ClearRef` (#118797)Sam Gross2024-05-101-0/+2
| | | | | | | | | | | _PyWeakref_ClearRef was previously exposed in the public C-API, although it begins with an underscore and is not documented. It's used by a few C-API extensions. There is currently no alternative public API that can replace its use. _PyWeakref_ClearWeakRefsExceptCallbacks is the only thread-safe way to use _PyWeakref_ClearRef in the free-threaded build. This exposes the C symbol, but does not make the API public.
* gh-111926: Make weakrefs thread-safe in free-threaded builds (#117168)mpage2024-04-081-0/+8
| | | | | | | | | Most mutable data is protected by a striped lock that is keyed on the referenced object's address. The weakref's hash is protected using the weakref's per-object lock. Note that this only affects free-threaded builds. Apart from some minor refactoring, the added code is all either gated by `ifdef`s or is a no-op (e.g. `Py_BEGIN_CRITICAL_SECTION`).
* gh-105927: Deprecate PyWeakref_GetObject() function (#106006)Victor Stinner2023-06-261-1/+2
| | | Deprecate PyWeakref_GetObject() and PyWeakref_GET_OBJECT() functions.
* gh-105927: Remove _PyWeakref_GetWeakrefCount() (#106007)Victor Stinner2023-06-231-4/+0
| | | | | | Remove _PyWeakref_GetWeakrefCount() and _PyWeakref_ClearRef() from the public C API: move them to the internal C API. Refactor also _weakref_getweakrefs() code to make it more readable.
* gh-89653: PEP 670: Macros always cast arguments in cpython/ (#93766)Victor Stinner2022-06-131-3/+1
| | | | Header files in the Include/cpython/ are only included if the Py_LIMITED_API macro is not defined.
* gh-92781: Avoid mixing declarations and code in C API (#92783)Victor Stinner2022-05-151-2/+4
| | | | | Avoid mixing declarations and code in the C API to fix the compiler warning: "ISO C90 forbids mixed declarations and code" [-Werror=declaration-after-statement].
* gh-89653: PEP 670: Limited API doesn't cast arguments (#92654)Victor Stinner2022-05-111-1/+3
| | | | | | | | The limited API version 3.11 no longer casts arguments to expected types of functions of functions: * PyList_GET_SIZE(), PyList_SET_ITEM() * PyTuple_GET_SIZE(), PyTuple_SET_ITEM() * PyWeakref_GET_OBJECT()
* gh-91320: Fix more old-style cast warnings in C++ (#92247)Victor Stinner2022-05-031-1/+1
| | | | | | | Use _Py_CAST(), _Py_STATIC_CAST() and _PyASCIIObject_CAST() in static inline functions to fix C++ compiler warnings: "use of old-style cast" (clang -Wold-style-cast). test_cppext now builds the C++ test extension with -Wold-style-cast.
* gh-89653: PEP 670: Convert PyWeakref_GET_OBJECT() to function (#91785)Victor Stinner2022-04-211-10/+16
| | | | | | Convert the PyWeakref_GET_OBJECT() macro to a static inline function. Add an assertion to check the argument with PyWeakref_Check(). Add a macro converting the argument to PyObject* to prevent emitting new compiler warning.
* bpo-46481: Implement vectorcall for weakref.ref.__call__ method. (GH-30820)Dong-hee Na2022-01-231-0/+1
|
* bpo-35134: Split warnings.h and weakrefobject.h (GH-29042)Victor Stinner2021-10-181-0/+47
Split header files to move the non-limited API to Include/cpython/: * Include/warnings.h => Include/cpython/warnings.h * Include/weakrefobject.h => Include/cpython/weakrefobject.h Exclude PyWeakref_GET_OBJECT() from the limited C API. It never worked since the PyWeakReference structure is opaque in the limited C API. Move _PyWarnings_Init() and _PyErr_WarnUnawaitedCoroutine() to the internal C API.