| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Move private functions to the internal C API (pycore_list.h):
* _PyList_Extend()
* _PyList_DebugMallocStats()
No longer export these functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyTuple_SET_ITEM() and PyList_SET_ITEM() now check the index argument
with an assertion if Python is built in debug mode or is built with
assertions.
* list_extend() and _PyList_AppendTakeRef() now set the list size
before calling PyList_SET_ITEM().
* PyStructSequence_GetItem() and PyStructSequence_SetItem() now check
the index argument: must be lesser than REAL_SIZE(op).
* PyStructSequence_GET_ITEM() and PyStructSequence_SET_ITEM() are now
aliases to PyStructSequence_GetItem() and
PyStructSequence_SetItem().
|
|
|
| |
Add unit test on Py_MEMBER_SIZE() and some other macros.
|
|
|
|
| |
Header files in the Include/cpython/ are only included if
the Py_LIMITED_API macro is not defined.
|
|
|
|
|
|
|
|
|
| |
Use the PyObject* type for parameters of static inline functions:
* Py_SIZE(): same parameter type than PyObject_Size()
* PyList_GET_SIZE(), PyList_SET_ITEM(): same parameter type than
PyList_Size() and PyList_SetItem()
* PyTuple_GET_SIZE(), PyTuple_SET_ITEM(): same parameter type than
PyTuple_Size() and PyTuple_SetItem().
|
|
|
|
|
|
|
|
| |
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()
|
|
|
| |
Rename also _Py_static_cast() to _Py_STATIC_CAST().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix C++ compiler warnings about "old-style cast"
(g++ -Wold-style-cast) in the Python C API. Use C++
reinterpret_cast<> and static_cast<> casts when the Python C API is
used in C++.
Example of fixed warning:
Include/object.h:107:43: error: use of old-style cast to
‘PyObject*’ {aka ‘struct _object*’} [-Werror=old-style-cast]
#define _PyObject_CAST(op) ((PyObject*)(op))
Add _Py_reinterpret_cast() and _Py_static_cast() macros.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert macros to static inline functions:
* PyTuple_GET_SIZE()
* PyTuple_SET_ITEM()
* PyList_GET_SIZE()
* PyList_SET_ITEM()
Add a macro converting arguments to PyTupleObject*, PyListObject* or
PyObject* to prevent emitting new compiler warnings.
According to PEP 670, PyTuple_GET_ITEM() and PyList_GET_ITEM() are
left as macros.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new _Py_RVALUE() macro to prevent using an expression as an
l-value.
Replace a "(void)" cast with the _Py_RVALUE() macro in the following
macros:
* PyCell_SET()
* PyList_SET_ITEM()
* PyTuple_SET_ITEM()
* _PyGCHead_SET_FINALIZED()
* _PyGCHead_SET_NEXT()
* asdl_seq_SET()
* asdl_seq_SET_UNTYPED()
Add also parentheses around macro arguments in PyCell_SET() and
PyTuple_SET_ITEM() macros.
|
|
|
| |
Do the same for PyTuple_SET_ITEM().
|
| |
|
|
|
|
|
| |
* Move _PyList_ITEMS() to pycore_list.h.
* The C extension "_heapq" is now built with Py_BUILD_CORE_MODULE
macro defined to access the internal C API.
|
|
|
|
| |
(GH-18413)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the following function from the C API:
* PyAsyncGen_ClearFreeLists()
* PyContext_ClearFreeList()
* PyDict_ClearFreeList()
* PyFloat_ClearFreeList()
* PyFrame_ClearFreeList()
* PyList_ClearFreeList()
* PySet_ClearFreeList()
* PyTuple_ClearFreeList()
Make these functions private, move them to the internal C API and
change their return type to void.
Call explicitly PyGC_Collect() to free all free lists.
Note: PySet_ClearFreeList() did nothing.
|
|
Move listobject.h code surrounded by "#ifndef Py_LIMITED_API"
to a new Include/cpython/listobject.h header file.
Add cpython/ header files to Makefile.pre.in and pythoncore project
of PCbuild.
Add _PyList_CAST() macro.
|