Skip to content

streams: Re-add support for arbitrary metadata for stream notifier functions #19158

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 2 commits into from
Jul 17, 2025

Conversation

TimWolla
Copy link
Member

Support for attaching arbitrary metadata for consumption by stream notifier functions got broken in #19024 when the previous zval ptr got changed to zend_fcall_info_cache *fcc, making the data specific to the user_space_stream_notifier.

Fix this by changing the field to void *ptr, avoiding the indirection through a zval, but preserving the ability to store arbitrary data. If necessary to support different types than IS_PTR, extensions can heap-allocate a zval to store within ->ptr as a minimal change to keep compatibility with PHP 8.4 or lower.

…nctions

Support for attaching arbitrary metadata for consumption by stream notifier
functions got broken in php#19024 when the previous `zval ptr` got
changed to `zend_fcall_info_cache *fcc`, making the data specific to the
`user_space_stream_notifier`.

Fix this by changing the field to `void *ptr`, avoiding the indirection through
a `zval`, but preserving the ability to store arbitrary data. If necessary to
support different types than `IS_PTR`, extensions can heap-allocate a `zval` to
store within `->ptr` as a minimal change to keep compatibility with PHP 8.4 or
lower.
@TimWolla TimWolla force-pushed the stream-notifier-ptr branch from 551dc7b to f1ef6f0 Compare July 17, 2025 13:31
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

Thanks for catching this

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

Thanks for catching this!

@TimWolla TimWolla merged commit 6b3f302 into php:master Jul 17, 2025
9 checks passed
@TimWolla TimWolla deleted the stream-notifier-ptr branch July 17, 2025 21:01
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy