This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Revert "croak_memory_wrap is an inline function."
authorKarl Williamson <khw@cpan.org>
Mon, 9 Mar 2020 23:47:09 +0000 (17:47 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 11 Mar 2020 22:54:16 +0000 (16:54 -0600)
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.

embed.fnc
inline.h
proto.h
util.c

index d45f5fb..60c5f3d 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2540,7 +2540,7 @@ ATpa      |Malloc_t|safesysmalloc |MEM_SIZE nbytes
 ATpa   |Malloc_t|safesyscalloc |MEM_SIZE elements|MEM_SIZE size
 ATpR   |Malloc_t|safesysrealloc|Malloc_t where|MEM_SIZE nbytes
 ATp    |Free_t |safesysfree    |Malloc_t where
-AirTep |void   |croak_memory_wrap
+CrTp   |void   |croak_memory_wrap
 #if defined(PERL_GLOBAL_STRUCT)
 Ap     |struct perl_vars *|GetVars
 Ap     |struct perl_vars*|init_global_struct
index 20aae02..73c9738 100644 (file)
--- a/inline.h
+++ b/inline.h
@@ -292,17 +292,6 @@ S_sv_or_pv_pos_u2b(pTHX_ SV *sv, const char *pv, STRLEN pos, STRLEN *lenp)
 }
 #endif
 
-/* ------------------------------- handy.h ------------------------------- */
-
-/* saves machine code for a common noreturn idiom typically used in Newx*() */
-GCC_DIAG_IGNORE_DECL(-Wunused-function);
-static void
-Perl_croak_memory_wrap(void)
-{
-    Perl_croak_nocontext("%s",PL_memory_wrap);
-}
-GCC_DIAG_RESTORE_DECL;
-
 /* ------------------------------- utf8.h ------------------------------- */
 
 /*
diff --git a/proto.h b/proto.h
index a6b6853..aebdc26 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -684,11 +684,9 @@ PERL_CALLCONV_NO_RET void  Perl_croak_caller(const char* pat, ...)
                        __attribute__format__null_ok__(__printf__,1,2);
 #define PERL_ARGS_ASSERT_CROAK_CALLER
 
-#ifndef PERL_NO_INLINE_FUNCTIONS
-PERL_STATIC_INLINE_NO_RET void Perl_croak_memory_wrap(void)
+PERL_CALLCONV_NO_RET void      Perl_croak_memory_wrap(void)
                        __attribute__noreturn__;
 #define PERL_ARGS_ASSERT_CROAK_MEMORY_WRAP
-#endif
 
 PERL_CALLCONV_NO_RET void      Perl_croak_no_mem(void)
                        __attribute__noreturn__;
diff --git a/util.c b/util.c
index 33e60b4..21625ad 100644 (file)
--- 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, ...)
 {