Skip to content

Commit e0975ca

Browse files
committed
Add zend_call_stack_default_size for AIX
1 parent 7d1b193 commit e0975ca

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎Zend/zend_call_stack.h‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,32 @@ static inline size_t zend_call_stack_default_size(void)
101101
#ifdef __sun
102102
return 8 * 4096;
103103
#endif
104+
#ifdef _AIX
105+
/*
106+
* default pthread stack limit is 96 KB on 32-bit, 192 KB on 64-bit
107+
* https://www.ibm.com/docs/en/aix/7.1.0?topic=programming-threads-library-options
108+
*/
109+
#ifdef HAVE_PTHREAD_GETTHRDS_NP /* if we have pthread linked (not in libc) */
110+
if (pthread_self() != 1) {
111+
#ifdef __64BIT__
112+
return 192 * 1024;
113+
#else
114+
return 96 * 1024;
115+
#endif
116+
}
117+
#endif
118+
/*
119+
* default AIX ulimit -s value is allegedly 32 MB, default values per:
120+
* https://www.ibm.com/docs/en/aix/7.1.0?topic=u-ulimit-command
121+
* N.B.: the the file uses 512b blocks, but the command uses kilobytes
122+
* https://www.ibm.com/support/pages/ibm-aix-security-ulimit-and-ulimit-d-output-differs-value-etcsecuritylimits
123+
*
124+
* note PASE uses an unlimited stack size by default, which is capped
125+
* at the PowerPC segment size (256 MB)
126+
*/
127+
return 32 * 1024 * 1024;
128+
#endif
129+
104130

105131
return 2 * 1024 * 1024;
106132
}

0 commit comments

Comments
 (0)