Skip to content

Commit 3ad6eb2

Browse files
committed
Merge branch 'main' into fix_clangcl_zlibng, because
some of the files tail-call.yml is watching were touched on main, and thus I think it will fire :)
2 parents 4bdf82f + 49fb75c commit 3ad6eb2

File tree

98 files changed

+1896
-774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1896
-774
lines changed

Doc/library/winsound.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,27 @@ provided by Windows platforms. It includes functions and several constants.
142142
to specify an application-defined sound alias.
143143

144144

145+
.. data:: SND_SENTRY
146+
147+
Triggers a SoundSentry event when the sound is played.
148+
149+
.. versionadded:: 3.14
150+
151+
152+
.. data:: SND_SYNC
153+
154+
The sound is played synchronously. This is the default behavior.
155+
156+
.. versionadded:: 3.14
157+
158+
159+
.. data:: SND_SYSTEM
160+
161+
Assign the sound to the audio session for system notification sounds.
162+
163+
.. versionadded:: 3.14
164+
165+
145166
.. data:: MB_ICONASTERISK
146167

147168
Play the ``SystemDefault`` sound.
@@ -166,3 +187,30 @@ provided by Windows platforms. It includes functions and several constants.
166187

167188
Play the ``SystemDefault`` sound.
168189

190+
191+
.. data:: MB_ICONERROR
192+
193+
Play the ``SystemHand`` sound.
194+
195+
.. versionadded:: 3.14
196+
197+
198+
.. data:: MB_ICONINFORMATION
199+
200+
Play the ``SystemDefault`` sound.
201+
202+
.. versionadded:: 3.14
203+
204+
205+
.. data:: MB_ICONSTOP
206+
207+
Play the ``SystemHand`` sound.
208+
209+
.. versionadded:: 3.14
210+
211+
212+
.. data:: MB_ICONWARNING
213+
214+
Play the ``SystemExclamation`` sound.
215+
216+
.. versionadded:: 3.14

Include/internal/pycore_gc.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -352,16 +352,6 @@ union _PyStackRef;
352352
extern int _PyGC_VisitFrameStack(_PyInterpreterFrame *frame, visitproc visit, void *arg);
353353
extern int _PyGC_VisitStackRef(union _PyStackRef *ref, visitproc visit, void *arg);
354354

355-
// Like Py_VISIT but for _PyStackRef fields
356-
#define _Py_VISIT_STACKREF(ref) \
357-
do { \
358-
if (!PyStackRef_IsNull(ref)) { \
359-
int vret = _PyGC_VisitStackRef(&(ref), visit, arg); \
360-
if (vret) \
361-
return vret; \
362-
} \
363-
} while (0)
364-
365355
#ifdef Py_GIL_DISABLED
366356
extern void _PyGC_VisitObjectsWorldStopped(PyInterpreterState *interp,
367357
gcvisitobjects_t callback, void *arg);

Include/internal/pycore_genobject.h

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,10 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11-
#include "pycore_interpframe.h" // _PyInterpreterFrame
11+
#include "pycore_interpframe_structs.h" // _PyGenObject
1212

13+
#include <stddef.h> // offsetof()
1314

14-
/* _PyGenObject_HEAD defines the initial segment of generator
15-
and coroutine objects. */
16-
#define _PyGenObject_HEAD(prefix) \
17-
PyObject_HEAD \
18-
/* List of weak reference. */ \
19-
PyObject *prefix##_weakreflist; \
20-
/* Name of the generator. */ \
21-
PyObject *prefix##_name; \
22-
/* Qualified name of the generator. */ \
23-
PyObject *prefix##_qualname; \
24-
_PyErr_StackItem prefix##_exc_state; \
25-
PyObject *prefix##_origin_or_finalizer; \
26-
char prefix##_hooks_inited; \
27-
char prefix##_closed; \
28-
char prefix##_running_async; \
29-
/* The frame */ \
30-
int8_t prefix##_frame_state; \
31-
_PyInterpreterFrame prefix##_iframe; \
32-
33-
struct _PyGenObject {
34-
/* The gi_ prefix is intended to remind of generator-iterator. */
35-
_PyGenObject_HEAD(gi)
36-
};
37-
38-
struct _PyCoroObject {
39-
_PyGenObject_HEAD(cr)
40-
};
41-
42-
struct _PyAsyncGenObject {
43-
_PyGenObject_HEAD(ag)
44-
};
45-
46-
#undef _PyGenObject_HEAD
4715

4816
static inline
4917
PyGenObject *_PyGen_GetGeneratorFromFrame(_PyInterpreterFrame *frame)

Include/internal/pycore_interpframe.h

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/* See InternalDocs/frames.md for an explanation of the frame stack
2-
* including explanation of the PyFrameObject and _PyInterpreterFrame
3-
* structs. */
4-
51
#ifndef Py_INTERNAL_INTERP_FRAME_H
62
#define Py_INTERNAL_INTERP_FRAME_H
73

@@ -10,49 +6,14 @@
106
#endif
117

128
#include "pycore_code.h" // _PyCode_CODE()
13-
#include "pycore_structs.h" // _PyStackRef
9+
#include "pycore_interpframe_structs.h" // _PyInterpreterFrame
1410
#include "pycore_stackref.h" // PyStackRef_AsPyObjectBorrow()
15-
#include "pycore_typedefs.h" // _PyInterpreterFrame
16-
11+
#include "pycore_stats.h" // CALL_STAT_INC()
1712

1813
#ifdef __cplusplus
1914
extern "C" {
2015
#endif
2116

22-
enum _frameowner {
23-
FRAME_OWNED_BY_THREAD = 0,
24-
FRAME_OWNED_BY_GENERATOR = 1,
25-
FRAME_OWNED_BY_FRAME_OBJECT = 2,
26-
FRAME_OWNED_BY_INTERPRETER = 3,
27-
FRAME_OWNED_BY_CSTACK = 4,
28-
};
29-
30-
struct _PyInterpreterFrame {
31-
_PyStackRef f_executable; /* Deferred or strong reference (code object or None) */
32-
struct _PyInterpreterFrame *previous;
33-
_PyStackRef f_funcobj; /* Deferred or strong reference. Only valid if not on C stack */
34-
PyObject *f_globals; /* Borrowed reference. Only valid if not on C stack */
35-
PyObject *f_builtins; /* Borrowed reference. Only valid if not on C stack */
36-
PyObject *f_locals; /* Strong reference, may be NULL. Only valid if not on C stack */
37-
PyFrameObject *frame_obj; /* Strong reference, may be NULL. Only valid if not on C stack */
38-
_Py_CODEUNIT *instr_ptr; /* Instruction currently executing (or about to begin) */
39-
_PyStackRef *stackpointer;
40-
#ifdef Py_GIL_DISABLED
41-
/* Index of thread-local bytecode containing instr_ptr. */
42-
int32_t tlbc_index;
43-
#endif
44-
uint16_t return_offset; /* Only relevant during a function call */
45-
char owner;
46-
#ifdef Py_DEBUG
47-
uint8_t visited:1;
48-
uint8_t lltrace:7;
49-
#else
50-
uint8_t visited;
51-
#endif
52-
/* Locals and stack */
53-
_PyStackRef localsplus[1];
54-
};
55-
5617
#define _PyInterpreterFrame_LASTI(IF) \
5718
((int)((IF)->instr_ptr - _PyFrame_GetBytecode((IF))))
5819

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/* Structures used by pycore_debug_offsets.h.
2+
*
3+
* See InternalDocs/frames.md for an explanation of the frame stack
4+
* including explanation of the PyFrameObject and _PyInterpreterFrame
5+
* structs.
6+
*/
7+
8+
#ifndef Py_INTERNAL_INTERP_FRAME_STRUCTS_H
9+
#define Py_INTERNAL_INTERP_FRAME_STRUCTS_H
10+
11+
#ifndef Py_BUILD_CORE
12+
# error "this header requires Py_BUILD_CORE define"
13+
#endif
14+
15+
#include "pycore_structs.h" // _PyStackRef
16+
#include "pycore_typedefs.h" // _PyInterpreterFrame
17+
18+
#ifdef __cplusplus
19+
extern "C" {
20+
#endif
21+
22+
enum _frameowner {
23+
FRAME_OWNED_BY_THREAD = 0,
24+
FRAME_OWNED_BY_GENERATOR = 1,
25+
FRAME_OWNED_BY_FRAME_OBJECT = 2,
26+
FRAME_OWNED_BY_INTERPRETER = 3,
27+
FRAME_OWNED_BY_CSTACK = 4,
28+
};
29+
30+
struct _PyInterpreterFrame {
31+
_PyStackRef f_executable; /* Deferred or strong reference (code object or None) */
32+
struct _PyInterpreterFrame *previous;
33+
_PyStackRef f_funcobj; /* Deferred or strong reference. Only valid if not on C stack */
34+
PyObject *f_globals; /* Borrowed reference. Only valid if not on C stack */
35+
PyObject *f_builtins; /* Borrowed reference. Only valid if not on C stack */
36+
PyObject *f_locals; /* Strong reference, may be NULL. Only valid if not on C stack */
37+
PyFrameObject *frame_obj; /* Strong reference, may be NULL. Only valid if not on C stack */
38+
_Py_CODEUNIT *instr_ptr; /* Instruction currently executing (or about to begin) */
39+
_PyStackRef *stackpointer;
40+
#ifdef Py_GIL_DISABLED
41+
/* Index of thread-local bytecode containing instr_ptr. */
42+
int32_t tlbc_index;
43+
#endif
44+
uint16_t return_offset; /* Only relevant during a function call */
45+
char owner;
46+
#ifdef Py_DEBUG
47+
uint8_t visited:1;
48+
uint8_t lltrace:7;
49+
#else
50+
uint8_t visited;
51+
#endif
52+
/* Locals and stack */
53+
_PyStackRef localsplus[1];
54+
};
55+
56+
57+
/* _PyGenObject_HEAD defines the initial segment of generator
58+
and coroutine objects. */
59+
#define _PyGenObject_HEAD(prefix) \
60+
PyObject_HEAD \
61+
/* List of weak reference. */ \
62+
PyObject *prefix##_weakreflist; \
63+
/* Name of the generator. */ \
64+
PyObject *prefix##_name; \
65+
/* Qualified name of the generator. */ \
66+
PyObject *prefix##_qualname; \
67+
_PyErr_StackItem prefix##_exc_state; \
68+
PyObject *prefix##_origin_or_finalizer; \
69+
char prefix##_hooks_inited; \
70+
char prefix##_closed; \
71+
char prefix##_running_async; \
72+
/* The frame */ \
73+
int8_t prefix##_frame_state; \
74+
_PyInterpreterFrame prefix##_iframe; \
75+
76+
struct _PyGenObject {
77+
/* The gi_ prefix is intended to remind of generator-iterator. */
78+
_PyGenObject_HEAD(gi)
79+
};
80+
81+
struct _PyCoroObject {
82+
_PyGenObject_HEAD(cr)
83+
};
84+
85+
struct _PyAsyncGenObject {
86+
_PyGenObject_HEAD(ag)
87+
};
88+
89+
#undef _PyGenObject_HEAD
90+
91+
92+
#ifdef __cplusplus
93+
}
94+
#endif
95+
#endif // !Py_INTERNAL_INTERP_FRAME_STRUCTS_H

Include/internal/pycore_object.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11-
#include <stdbool.h>
1211
#include "pycore_emscripten_trampoline.h" // _PyCFunction_TrampolineCall()
13-
#include "pycore_object_deferred.h" // _PyObject_HasDeferredRefcount
14-
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_STORE_PTR_RELAXED
12+
#include "pycore_gc.h" // _PyObject_GC_TRACK()
13+
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_LOAD_PTR_ACQUIRE()
1514
#include "pycore_pystate.h" // _PyInterpreterState_GET()
1615
#include "pycore_runtime.h" // _PyRuntime
1716
#include "pycore_typeobject.h" // _PyStaticType_GetState()
1817
#include "pycore_uniqueid.h" // _PyObject_ThreadIncrefSlow()
1918

19+
#include <stdbool.h> // bool
20+
21+
2022
// This value is added to `ob_ref_shared` for objects that use deferred
2123
// reference counting so that they are not immediately deallocated when the
2224
// non-deferred reference count drops to zero.

Include/internal/pycore_optimizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ typedef struct _jit_opt_tuple {
202202

203203
typedef struct {
204204
uint8_t tag;
205-
bool not;
205+
bool invert;
206206
uint16_t value;
207207
} JitOptTruthiness;
208208

Include/internal/pycore_runtime_structs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ struct _fileutils_state {
6464
int force_ascii;
6565
};
6666

67+
#include "pycore_interpframe_structs.h" // _PyInterpreterFrame
6768
#include "pycore_debug_offsets.h" // _Py_DebugOffsets
6869
#include "pycore_signal.h" // struct _signals_runtime_state
6970
#include "pycore_faulthandler.h" // struct _faulthandler_runtime_state

Include/internal/pycore_setobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ PyAPI_FUNC(int) _PySet_Contains(PySetObject *so, PyObject *key);
3333
// Clears the set without acquiring locks. Used by _PyCode_Fini.
3434
extern void _PySet_ClearInternal(PySetObject *so);
3535

36+
PyAPI_FUNC(int) _PySet_AddTakeRef(PySetObject *so, PyObject *key);
37+
3638
#ifdef __cplusplus
3739
}
3840
#endif

Include/internal/pycore_stackref.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ extern "C" {
1313
# error "this header requires Py_BUILD_CORE define"
1414
#endif
1515

16-
#include "pycore_object_deferred.h"
17-
#include "pycore_object.h"
16+
#include "pycore_object.h" // Py_DECREF_MORTAL
17+
#include "pycore_object_deferred.h" // _PyObject_HasDeferredRefcount()
18+
19+
#include <stdbool.h> // bool
1820

19-
#include <stddef.h>
20-
#include <stdbool.h>
2121

2222
/*
2323
This file introduces a new API for handling references on the stack, called
@@ -658,6 +658,16 @@ _Py_TryIncrefCompareStackRef(PyObject **src, PyObject *op, _PyStackRef *out)
658658

659659
#endif
660660

661+
// Like Py_VISIT but for _PyStackRef fields
662+
#define _Py_VISIT_STACKREF(ref) \
663+
do { \
664+
if (!PyStackRef_IsNull(ref)) { \
665+
int vret = _PyGC_VisitStackRef(&(ref), visit, arg); \
666+
if (vret) \
667+
return vret; \
668+
} \
669+
} while (0)
670+
661671
#ifdef __cplusplus
662672
}
663673
#endif

0 commit comments

Comments
 (0)