mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
GH-124715: Move trashcan mechanism into Py_Dealloc (GH-132280)
This commit is contained in:
parent
0f23e84cda
commit
44e4c479fb
26 changed files with 88 additions and 196 deletions
|
|
@ -26,17 +26,25 @@ PyAPI_DATA(int) (*PyOS_InputHook)(void);
|
|||
* apart. In practice, that means it must be larger than the C
|
||||
* stack consumption of PyEval_EvalDefault */
|
||||
#if defined(_Py_ADDRESS_SANITIZER) || defined(_Py_THREAD_SANITIZER)
|
||||
# define PYOS_STACK_MARGIN 4096
|
||||
# define PYOS_LOG2_STACK_MARGIN 12
|
||||
#elif defined(Py_DEBUG) && defined(WIN32)
|
||||
# define PYOS_STACK_MARGIN 4096
|
||||
# define PYOS_LOG2_STACK_MARGIN 12
|
||||
#elif defined(__wasi__)
|
||||
/* Web assembly has two stacks, so this isn't really a size */
|
||||
# define PYOS_STACK_MARGIN 500
|
||||
# define PYOS_LOG2_STACK_MARGIN 9
|
||||
#else
|
||||
# define PYOS_STACK_MARGIN 2048
|
||||
# define PYOS_LOG2_STACK_MARGIN 11
|
||||
#endif
|
||||
#define PYOS_STACK_MARGIN (1 << PYOS_LOG2_STACK_MARGIN)
|
||||
#define PYOS_STACK_MARGIN_BYTES (PYOS_STACK_MARGIN * sizeof(void *))
|
||||
|
||||
#if SIZEOF_VOID_P == 8
|
||||
#define PYOS_STACK_MARGIN_SHIFT (PYOS_LOG2_STACK_MARGIN + 3)
|
||||
#else
|
||||
#define PYOS_STACK_MARGIN_SHIFT (PYOS_LOG2_STACK_MARGIN + 2)
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(WIN32)
|
||||
#define USE_STACKCHECK
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue