-
Notifications
You must be signed in to change notification settings - Fork 567
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
hv.c: Macro to check an HV as being %ENV hash #23076
base: blead
Are you sure you want to change the base?
Conversation
Huh wow, Windows actually isn't happy with this. I wonder why... It builds OK but then fails tests. |
Do we have tests for appropriate behaviour of modifications to either the replacement hash or the original hash during the scope of a |
backtrace
I'll look into it further. |
This normally only matters on Windows and VMS, the calls to hv_is_env() are all guarded by If I build on linux with
Changing:
allowed the threads and Thread-Queue tests to pass locally for me. |
0d09226
to
d7f8f8c
Compare
Aha - thanks for the hint @tonycoz - the |
@hvds That is an interesting point about However, an interesting point is that the old hash (which don't forget, still exists as an HV and could be visible) does still have |
To me, the current behavior is what I would expect and I would find the new behavior from this PR confusing. |
I agree with @haarg. The code being changed is already guarded by SvMAGICAL(), so it only executes for magical HVs anyway, so the performance improvement is going to be tiny. If hooks ends up getting in with aggregate support I can see the ENV and tie special casing being moved to hooks. |
I agree with @haarg as well. The current behavior is correct, not incidental. |
Previous code would invoke an entire `mg_find()` call just to check if the given HV happens to have `PERL_MAGIC_env`. This hardcodes knowledge of the `PERL_MAGIC_env` type in a lot of places that don't really care about it.
d7f8f8c
to
62c5e2a
Compare
Recreated as a simple macro that just moves out the existing code into a convenient function-like macro, so at least there's only one place to change in future rather than multiple. |
I agree with the others that the proposed new behavior had too many new sharp edges, but |
After discussing this in the PSC meeting, we all agreed that the current behavior is correct. |
Previous code would invoke an entire
mg_find()
call just to check if the given HV happens to havePERL_MAGIC_env
. This hardcodes knowledge of thePERL_MAGIC_env
type in a lot of places that don't really care about it.