summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-03-18 12:22:34 +0100
committerYves Orton <demerphq@gmail.com>2023-03-19 05:27:01 +0800
commit4d51d5bc07c99bc5811ccbae1503b27d813e0743 (patch)
treeff38500149226af0ce009e6acd0e75653ec24656 /perl.h
parent0d5b46c9e4cecc121ba79df380cde0ae037d16f7 (diff)
downloadperl-4d51d5bc07c99bc5811ccbae1503b27d813e0743.tar.gz
regen/embed.pl - change _aDEPTH and _pDEPTH to not have a leading underbar
The leading underbar is reserved by C. These defines are debugging only "recursion" depth related counters injected into the function macro wrappers when a function is marked as 'W', much the same way that aTHX_ and pTHX_ are when building under threaded builds. The functions are expected to incremented the depth parameter themselves. Note that "recursion" is quoted above because in practice currently they are only used by the regex engine when recursing virtually, and they do not relate to true C stack related recursion. (But they could be used for tracking C level recursion under debugging if someone needed it.)
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/perl.h b/perl.h
index 6f7f2292eb..9b719bf272 100644
--- a/perl.h
+++ b/perl.h
@@ -30,7 +30,7 @@
/*
=for apidoc_section $debugging
-=for apidoc CmnW ||_aDEPTH
+=for apidoc CmnW ||comma_aDEPTH
Some functions when compiled under DEBUGGING take an extra final argument named
C<depth>, indicating the C stack depth. This argument is omitted otherwise.
This macro expands to either S<C<, depth>> under DEBUGGING, or to nothing at
@@ -38,20 +38,32 @@ all when not under DEBUGGING, reducing the number of C<#ifdef>'s in the code.
The program is responsible for maintaining the correct value for C<depth>.
-=for apidoc CyW ||_pDEPTH
-This is used in the prototype declarations for functions that take a L</C<_aDEPTH>>
+=for apidoc CyW ||comma_pDEPTH
+This is used in the prototype declarations for functions that take a L</C<comma_aDEPTH>>
final parameter, much like L<C<pTHX_>|perlguts/Background and MULTIPLICITY>
is used in functions that take a thread context initial parameter.
+=for apidoc CmnW ||debug_aDEPTH
+Same as L</C<comma_aDEPTH>> but with no leading argument. Intended for functions with
+no normal arguments, and used by L</C<comma_aDEPTH>> itself.
+
+=for apidoc CmnW ||debug_pDEPTH
+Same as L</C<comma_pDEPTH>> but with no leading argument. Intended for functions with
+no normal arguments, and used by L</C<comma_pDEPTH>> itself.
+
=cut
*/
#ifdef DEBUGGING
-# define _pDEPTH ,U32 depth
-# define _aDEPTH ,depth
+# define debug_pDEPTH U32 depth
+# define comma_pDEPTH ,debug_pDEPTH
+# define debug_aDEPTH depth
+# define comma_aDEPTH ,debug_aDEPTH
#else
-# define _pDEPTH
-# define _aDEPTH
+# define debug_aDEPTH
+# define comma_aDEPTH
+# define debug_pDEPTH
+# define comma_pDEPTH
#endif
/* NOTE 1: that with gcc -std=c89 the __STDC_VERSION__ is *not* defined