Skip to content

Commit 382d101

Browse files
committed
Merge branch 'main' into use-stackrefs
2 parents d23ae47 + e62e1ca commit 382d101

35 files changed

+463
-128
lines changed

Doc/c-api/object.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,12 @@ Object Protocol
509509
iterated.
510510
511511
512+
.. c:function:: PyObject* PyObject_SelfIter(PyObject *obj)
513+
514+
This is equivalent to the Python ``__iter__(self): return self`` method.
515+
It is intended for :term:`iterator` types, to be used in the :c:member:`PyTypeObject.tp_iter` slot.
516+
517+
512518
.. c:function:: PyObject* PyObject_GetAIter(PyObject *o)
513519
514520
This is the equivalent to the Python expression ``aiter(o)``. Takes an

Doc/data/refcounts.dat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,9 @@ PyObject_RichCompareBool:PyObject*:o1:0:
18491849
PyObject_RichCompareBool:PyObject*:o2:0:
18501850
PyObject_RichCompareBool:int:opid::
18511851

1852+
PyObject_SelfIter:PyObject*::+1:
1853+
PyObject_SelfIter:PyObject*:obj:0:
1854+
18521855
PyObject_SetAttr:int:::
18531856
PyObject_SetAttr:PyObject*:o:0:
18541857
PyObject_SetAttr:PyObject*:attr_name:0:

Doc/library/http.cookies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Cookie Objects
9898
.. method:: BaseCookie.output(attrs=None, header='Set-Cookie:', sep='\r\n')
9999

100100
Return a string representation suitable to be sent as HTTP headers. *attrs* and
101-
*header* are sent to each :class:`Morsel`'s :meth:`output` method. *sep* is used
101+
*header* are sent to each :class:`Morsel`'s :meth:`~Morsel.output` method. *sep* is used
102102
to join the headers together, and is by default the combination ``'\r\n'``
103103
(CRLF).
104104

Doc/library/traceback.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Module-Level Functions
274274
:class:`!TracebackException` objects are created from actual exceptions to
275275
capture data for later printing. They offer a more lightweight method of
276276
storing this information by avoiding holding references to
277-
:ref:`traceback<traceback-objects>` and :ref:`frame<frame-objects>` objects
277+
:ref:`traceback<traceback-objects>` and :ref:`frame<frame-objects>` objects.
278278
In addition, they expose more options to configure the output compared to
279279
the module-level functions described above.
280280

Include/internal/pycore_freelist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static inline int
5151
_PyFreeList_Push(struct _Py_freelist *fl, void *obj, Py_ssize_t maxsize)
5252
{
5353
if (fl->size < maxsize && fl->size >= 0) {
54-
*(void **)obj = fl->freelist;
54+
FT_ATOMIC_STORE_PTR_RELAXED(*(void **)obj, fl->freelist);
5555
fl->freelist = obj;
5656
fl->size++;
5757
OBJECT_STAT_INC(to_freelist);

Include/internal/pycore_freelist_state.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ extern "C" {
1414
# define Py_dicts_MAXFREELIST 80
1515
# define Py_dictkeys_MAXFREELIST 80
1616
# define Py_floats_MAXFREELIST 100
17+
# define Py_ints_MAXFREELIST 100
1718
# define Py_slices_MAXFREELIST 1
1819
# define Py_contexts_MAXFREELIST 255
1920
# define Py_async_gens_MAXFREELIST 80
@@ -35,6 +36,7 @@ struct _Py_freelist {
3536

3637
struct _Py_freelists {
3738
struct _Py_freelist floats;
39+
struct _Py_freelist ints;
3840
struct _Py_freelist tuples[PyTuple_MAXSAVESIZE];
3941
struct _Py_freelist lists;
4042
struct _Py_freelist dicts;

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ struct _Py_global_strings {
618618
STRUCT_FOR_ID(origin)
619619
STRUCT_FOR_ID(out_fd)
620620
STRUCT_FOR_ID(outgoing)
621+
STRUCT_FOR_ID(outpath)
621622
STRUCT_FOR_ID(overlapped)
622623
STRUCT_FOR_ID(owner)
623624
STRUCT_FOR_ID(pages)

Include/internal/pycore_long.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ extern void _PyLong_FiniTypes(PyInterpreterState *interp);
5555

5656
/* other API */
5757

58+
PyAPI_FUNC(void) _PyLong_ExactDealloc(PyObject *self);
59+
5860
#define _PyLong_SMALL_INTS _Py_SINGLETON(small_ints)
5961

6062
// _PyLong_GetZero() and _PyLong_GetOne() must always be available

Include/internal/pycore_optimizer.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ typedef struct {
6060
};
6161
uint64_t operand0; // A cache entry
6262
uint64_t operand1;
63+
#ifdef Py_STATS
64+
uint64_t execution_count;
65+
#endif
6366
} _PyUOpInstruction;
6467

6568
typedef struct {
@@ -285,6 +288,8 @@ static inline int is_terminator(const _PyUOpInstruction *uop)
285288
);
286289
}
287290

291+
PyAPI_FUNC(int) _PyDumpExecutors(FILE *out);
292+
288293
#ifdef __cplusplus
289294
}
290295
#endif

0 commit comments

Comments
 (0)