diff options
author | xdegaye <xdegaye@gmail.com> | 2019-12-08 08:40:14 +0100 |
---|---|---|
committer | Victor Stinner <vstinner@python.org> | 2019-12-08 08:40:14 +0100 |
commit | 00ada2c1d57c5b8b468bad32ff24fa14113ae5c7 (patch) | |
tree | 9cba1b64616dfa4d5c2c23a255f06f07507f1e73 /Python | |
parent | 6cac1136665b70f72db291b95876d7affcf1d2db (diff) | |
download | cpython-git-00ada2c1d57c5b8b468bad32ff24fa14113ae5c7.tar.gz |
bpo-38852: Set thread stack size to 8 Mb for debug builds on android platforms (GH-17337)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/thread_pthread.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index b9a340530c..ff4266c72b 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -51,6 +51,16 @@ #undef THREAD_STACK_SIZE #define THREAD_STACK_SIZE 0x200000 #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 */ #define THREAD_STACK_MIN 0x8000 /* 32 KiB */ #else /* !_POSIX_THREAD_ATTR_STACKSIZE */ |