File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ PHP NEWS
1919 a non-Generator delegate crashes). (Arnaud)
2020 . Fixed bug GH-18736 (Circumvented type check with return by ref + finally).
2121 (ilutov)
22+ . Fixed zend call stack size for macOs/arm64. (David Carlier)
2223
2324- FTP:
2425 . Fix theoretical issues with hrtime() not being available. (nielsdos)
Original file line number Diff line number Diff line change @@ -15,7 +15,10 @@ $stack = zend_test_zend_call_stack_get();
1515var_dump ($ stack );
1616
1717$ expectedMaxSize = match (php_uname ('s ' )) {
18- 'Darwin ' => 8 *1024 *1024 ,
18+ 'Darwin ' => match (php_uname ('m ' )) {
19+ 'x86_64 ' => 8 *1024 *1024 ,
20+ 'arm64 ' => 8372224 ,
21+ },
1922 'FreeBSD ' => match (php_uname ('m ' )) {
2023 'amd64 ' => 512 *1024 *1024 - 4096 ,
2124 'i386 ' => 64 *1024 *1024 - 4096 ,
Original file line number Diff line number Diff line change @@ -417,7 +417,9 @@ static bool zend_call_stack_get_macos(zend_call_stack *stack)
417417 void * base = pthread_get_stackaddr_np (pthread_self ());
418418 size_t max_size ;
419419
420- if (pthread_main_np ()) {
420+ #if !defined(__aarch64__ )
421+ if (pthread_main_np ())
422+ {
421423 /* pthread_get_stacksize_np() returns a too low value for the main
422424 * thread in OSX 10.9, 10.10:
423425 * https://mail.openjdk.org/pipermail/hotspot-dev/2013-October/011353.html
@@ -427,7 +429,10 @@ static bool zend_call_stack_get_macos(zend_call_stack *stack)
427429 /* Stack size is 8MiB by default for main threads
428430 * https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html */
429431 max_size = 8 * 1024 * 1024 ;
430- } else {
432+ }
433+ else
434+ #endif
435+ {
431436 max_size = pthread_get_stacksize_np (pthread_self ());
432437 }
433438
You can’t perform that action at this time.
0 commit comments