diff options
author | Yves Orton <demerphq@gmail.com> | 2023-03-04 14:19:25 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-03-06 14:43:25 +0800 |
commit | 624f6f53b1081642aea65e1f3f172bcaad6c12c7 (patch) | |
tree | 4731cfddc244093185954ae3d891466d46319d99 /proto.h | |
parent | ad2d7a7b8430731f134374105121d039762c6f6c (diff) | |
download | perl-624f6f53b1081642aea65e1f3f172bcaad6c12c7.tar.gz |
scope.c - improved RCPV support, SAVERCPV SAVEFREERCPV
I misnamed some of the RCPV stuff when it was introduced. The macro
which I called SAVERCPVFREE should have been called SAVERCPV,
and there should also have been a SAVEFREERCPV macro.
Note the naming system for these functions is a bit confusing.
SAVEFREERCPV /just/ frees. SAVERCPV saves and restores (eg, its like
local). SAVEFREESV is an exception. :-( and it behaves like SAVERCPV.
See for instance SAVEPV or similar macros.
There also should have been RCPV_REFCNT_dec() and RCPV_REFCNT_inc()
macros.
There was also missing documentation. This patch should fix all of these
issues. Since this functionality has never been released in a production
perl it should be fine to do these renames, nothing out there should use
these macros yet.
I noticed these oversights while fixing Scope::Upper, see also:
https://github.com/Perl/perl5/issues/20861
https://rt.cpan.org/Ticket/Display.html?id=146897
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -3938,6 +3938,11 @@ Perl_save_destructor_x(pTHX_ DESTRUCTORFUNC_t f, void *p); #define PERL_ARGS_ASSERT_SAVE_DESTRUCTOR_X PERL_CALLCONV void +Perl_save_freercpv(pTHX_ char *rcpv); +#define PERL_ARGS_ASSERT_SAVE_FREERCPV \ + assert(rcpv) + +PERL_CALLCONV void Perl_save_generic_pvref(pTHX_ char **str); #define PERL_ARGS_ASSERT_SAVE_GENERIC_PVREF \ assert(str) @@ -4017,9 +4022,9 @@ Perl_save_pushptrptr(pTHX_ void * const ptr1, void * const ptr2, const int type) #define PERL_ARGS_ASSERT_SAVE_PUSHPTRPTR PERL_CALLCONV void -Perl_save_rcpv_free(pTHX_ char **ppv); -#define PERL_ARGS_ASSERT_SAVE_RCPV_FREE \ - assert(ppv) +Perl_save_rcpv(pTHX_ char **prcpv); +#define PERL_ARGS_ASSERT_SAVE_RCPV \ + assert(prcpv) PERL_CALLCONV void Perl_save_re_context(pTHX); |