Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Zend/zend_call_stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#ifdef __APPLE__
# include <pthread.h>
#endif
#ifdef __FreeBSD__
# include <pthread_np.h>
#endif

#ifdef ZEND_CHECK_STACK_LIMIT

Expand Down Expand Up @@ -76,7 +79,14 @@ static inline size_t zend_call_stack_default_size(void)
#ifdef __linux__
return 8 * 1024 * 1024;
#endif
#if defined(__FreeBSD__) || defined(__NetBSD__)
#ifdef __FreeBSD__
// libthr: THR_STACK_DEFAULT in lib/libthr/thread/thr_private.h
if (pthread_main_np() == 0) {
return sizeof(void *) / 4 * 1024 * 1024;
}
return 4 * 1024 * 1024;
#endif
#ifdef __NetBSD__
return 4 * 1024 * 1024;
#endif
#if defined(__DragonFly__)
Expand Down
Loading