Skip to content

Revert "Attempt to remove deprecated sv_locking/unlocking" #23475

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 26, 2025
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -3274,7 +3274,10 @@ ARdp |SV * |sv_mortalcopy_flags \
|U32 flags
ARdp |SV * |sv_newmortal
Cdp |SV * |sv_newref |NULLOK SV * const sv
ADbdp |void |sv_nolocking |NULLOK SV *sv

Adp |void |sv_nosharing |NULLOK SV *sv
ADbdp |void |sv_nounlocking |NULLOK SV *sv
: Used in pp.c, pp_hot.c, sv.c
dpx |SV * |sv_2num |NN SV * const sv
Adm |bool |sv_numeq |NULLOK SV *sv1 \
Expand Down
2 changes: 2 additions & 0 deletions embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@
# endif
# endif
# if !defined(NO_MATHOMS)
# define sv_nolocking(a) Perl_sv_nolocking(aTHX_ a)
# define sv_nounlocking(a) Perl_sv_nounlocking(aTHX_ a)
# define utf8_to_uvchr(a,b) Perl_utf8_to_uvchr(aTHX_ a,b)
# define utf8_to_uvuni(a,b) Perl_utf8_to_uvuni(aTHX_ a,b)
# define utf8n_to_uvuni(a,b,c,d) Perl_utf8n_to_uvuni(aTHX_ a,b,c,d)
Expand Down
8 changes: 7 additions & 1 deletion intrpvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,13 @@ PERLVARI(I, lockhook, share_proc_t, Perl_sv_nosharing)
GCC_DIAG_IGNORE(-Wdeprecated-declarations)
MSVC_DIAG_IGNORE(4996)

PERLVARI(I, unlockhook, share_proc_t, Perl_sv_nosharing)
#ifdef NO_MATHOMS
# define PERL_UNLOCK_HOOK Perl_sv_nosharing
#else
/* This reference ensures that the mathoms are linked with perl */
# define PERL_UNLOCK_HOOK Perl_sv_nounlocking
#endif
PERLVARI(I, unlockhook, share_proc_t, PERL_UNLOCK_HOOK)

MSVC_DIAG_RESTORE
GCC_DIAG_RESTORE
Expand Down
45 changes: 45 additions & 0 deletions mathoms.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,51 @@ Perl_do_aexec(pTHX_ SV *really, SV **mark, SV **sp)
}
#endif

/*
=for apidoc_section $SV
=for apidoc sv_nolocking

Dummy routine which "locks" an SV when there is no locking module present.
Exists to avoid test for a C<NULL> function pointer and because it could
potentially warn under some level of strict-ness.

"Superseded" by C<sv_nosharing()>.

=cut
*/

void
Perl_sv_nolocking(pTHX_ SV *sv)
{
PERL_UNUSED_CONTEXT;
PERL_UNUSED_ARG(sv);
}


/*
=for apidoc_section $SV
=for apidoc sv_nounlocking

Dummy routine which "unlocks" an SV when there is no locking module present.
Exists to avoid test for a C<NULL> function pointer and because it could
potentially warn under some level of strict-ness.

"Superseded" by C<sv_nosharing()>.

=cut

PERL_UNLOCK_HOOK in intrpvar.h is the macro that refers to this, and guarantees
that mathoms gets loaded.

*/

void
Perl_sv_nounlocking(pTHX_ SV *sv)
{
PERL_UNUSED_CONTEXT;
PERL_UNUSED_ARG(sv);
}

void
Perl_sv_usepvn_mg(pTHX_ SV *sv, char *ptr, STRLEN len)
{
Expand Down
3 changes: 1 addition & 2 deletions pod/perldelta.pod
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ well.

=item *

Removed the deprecated (since 5.32) functions C<sv_locking()> and
C<sv_unlocking>.
XXX

=back

Expand Down
10 changes: 10 additions & 0 deletions proto.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading