Skip to content

Remove unused ZEND_STACK_GROWS_DOWNWARDS constant #11762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2023

Conversation

petk
Copy link
Member

@petk petk commented Jul 22, 2023

  • Check for pthread_attr_getstack defines HAVE_PTHREAD_ATTR_GETSTACK which is not used in the code.
  • ZEND_STACK_GROWS_DOWNWARDS is also not used in the code.

Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good even tough I wonder where HAVE_PTHREAD_ATTR_GET_STACK comes from (typo maybe) as it does not apply for FreeBSD it is pthead_attr_getstack too. Could be fixed separately eventually.

Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good even tough I wonder where HAVE_PTHREAD_ATTR_GET_STACK comes from (typo maybe) as it does not apply for FreeBSD it is pthead_attr_getstack too. Could be fixed separately eventually.

@petk
Copy link
Member Author

petk commented Jul 22, 2023

@devnexen, when running ./buildconf it creates main/php_config.h.in with this:

/* Define to 1 if you have the `pthread_attr_getstack' function. */
#undef HAVE_PTHREAD_ATTR_GETSTACK

then when running ./configure it runs the check for the pthread_attr_getstack. If pthreads.h is there, which probably is on some of the Linux and BSD variants, then this is added to the newly created main/php_config.h:

/* Define to 1 if you have the `pthread_attr_getstack' function. */
#define HAVE_PTHREAD_ATTR_GETSTACK 1

Perhaps it was meant for the Zend/zend_call_stack.c where pthread_get_stackaddr_np is used and guard with __APPLE__ and HAVE_PTHREAD_GET_STACKADDR_NP is added there. Yes, probably...

@petk petk force-pushed the patch-autoconf-1 branch from 0a19a04 to 3a1d8ae Compare July 22, 2023 15:42
@petk petk changed the title Remove two unused constants Remove unused ZEND_STACK_GROWS_DOWNWARDS constant Jul 22, 2023
@petk
Copy link
Member Author

petk commented Jul 22, 2023

I've changed this into only a single change due to usage of pthread_attr_getstack and typo constant HAVE_PTHREAD_ATTR_GET_STACK which is being resolved here then #11766

@arnaud-lb arnaud-lb merged commit 9911ab7 into php:master Jul 22, 2023
@arnaud-lb
Copy link
Member

Thank you!

@petk petk deleted the patch-autoconf-1 branch July 22, 2023 17:52
jorgsowa pushed a commit to jorgsowa/php-src that referenced this pull request Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants