summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-03-09 17:47:09 -0600
committerKarl Williamson <khw@cpan.org>2020-03-11 16:54:16 -0600
commitd68c938a1e6c6b4bfe907decbb4929780ee06eae (patch)
treeb8416409df2721642467832a69d15102299ef0bf /util.c
parentfd8ce3da25472276b0923b6f9a6c685b77d63b09 (diff)
downloadperl-d68c938a1e6c6b4bfe907decbb4929780ee06eae.tar.gz
Revert "croak_memory_wrap is an inline function."
This reverts commit 6c714a09cc08600278e72aea1fcdf83576d061b4. croak_memory_wrap is designed to save a few bytes of memory, and was never intended to be inlined. This commit moves it to util.c where the other croak functions are.
Diffstat (limited to 'util.c')
-rw-r--r--util.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/util.c b/util.c
index 33e60b4a17..21625ad9b9 100644
--- a/util.c
+++ b/util.c
@@ -1766,6 +1766,15 @@ Perl_croak_nocontext(const char *pat, ...)
}
#endif /* PERL_IMPLICIT_CONTEXT */
+/* saves machine code for a common noreturn idiom typically used in Newx*() */
+GCC_DIAG_IGNORE_DECL(-Wunused-function);
+void
+Perl_croak_memory_wrap(void)
+{
+ Perl_croak_nocontext("%s",PL_memory_wrap);
+}
+GCC_DIAG_RESTORE_DECL;
+
void
Perl_croak(pTHX_ const char *pat, ...)
{