summaryrefslogtreecommitdiff
path: root/inline.h
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafayette.edu>2013-03-27 15:54:05 -0400
committerAndy Dougherty <doughera@lafayette.edu>2013-03-28 16:49:37 -0400
commit43387ee1abcd83c3c7586b7f7aa86e838d239aac (patch)
tree89766800af3f0f19490b84e6f9bb305ac8cc578b /inline.h
parentcbe4d57f99858fe05f2e924ad9125b9b9e50504e (diff)
downloadperl-43387ee1abcd83c3c7586b7f7aa86e838d239aac.tar.gz
Remove the non-inline function S_croak_memory_wrap from inline.h.
This appears to resolve these three related tickets: [perl #116989] S_croak_memory_wrap breaks gcc warning flags detection [perl #117319] Can't include perl.h without linking to libperl [perl #117331] Time::HiRes::clock_gettime not implemented on Linux (regression?) This patch changes S_croak_memory_wrap from a static (but not inline) function into an ordinary exported function Perl_croak_memory_wrap. This has the advantage of allowing programs (particuarly probes, such as in cflags.SH and Time::HiRes) to include perl.h without linking against libperl. Since it is not a static function defined within each compilation unit, the optimizer can no longer remove it when it's not needed or inline it as needed. This likely negates some of the savings that motivated the original commit 380f764c1ead36fe3602184804292711. However, calling the simpler function Perl_croak_memory_wrap() still does take less set-up than the previous version, so it may still be a slight win. Specific cross-platform measurements are welcome.
Diffstat (limited to 'inline.h')
-rw-r--r--inline.h16
1 files changed, 0 insertions, 16 deletions
diff --git a/inline.h b/inline.h
index 6cdfe9f178..953bb33cff 100644
--- a/inline.h
+++ b/inline.h
@@ -134,22 +134,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*() */
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-function"
-#endif
-static void
-S_croak_memory_wrap(void)
-{
- Perl_croak_nocontext("%s",PL_memory_wrap);
-}
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
/* ------------------------------- utf8.h ------------------------------- */
/* These exist only to replace the macros they formerly were so that their use