mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-38852: Set thread stack size to 8 Mb for debug builds on android platforms (GH-17337)
This commit is contained in:
parent
6cac113666
commit
00ada2c1d5
2 changed files with 11 additions and 0 deletions
|
@ -0,0 +1 @@
|
||||||
|
Set the thread stack size to 8 Mb for debug builds on android platforms.
|
|
@ -51,6 +51,16 @@
|
||||||
#undef THREAD_STACK_SIZE
|
#undef THREAD_STACK_SIZE
|
||||||
#define THREAD_STACK_SIZE 0x200000
|
#define THREAD_STACK_SIZE 0x200000
|
||||||
#endif
|
#endif
|
||||||
|
/* bpo-38852: test_threading.test_recursion_limit() checks that 1000 recursive
|
||||||
|
Python calls (default recursion limit) doesn't crash, but raise a regular
|
||||||
|
RecursionError exception. In debug mode, Python function calls allocates
|
||||||
|
more memory on the stack, so use a stack of 8 MiB. */
|
||||||
|
#if defined(__ANDROID__) && defined(THREAD_STACK_SIZE) && THREAD_STACK_SIZE == 0
|
||||||
|
# ifdef Py_DEBUG
|
||||||
|
# undef THREAD_STACK_SIZE
|
||||||
|
# define THREAD_STACK_SIZE 0x800000
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
/* for safety, ensure a viable minimum stacksize */
|
/* for safety, ensure a viable minimum stacksize */
|
||||||
#define THREAD_STACK_MIN 0x8000 /* 32 KiB */
|
#define THREAD_STACK_MIN 0x8000 /* 32 KiB */
|
||||||
#else /* !_POSIX_THREAD_ATTR_STACKSIZE */
|
#else /* !_POSIX_THREAD_ATTR_STACKSIZE */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue