This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
embed.fnc: Mark some inline functions as such
authorKarl Williamson <khw@cpan.org>
Tue, 31 Jan 2023 01:20:58 +0000 (18:20 -0700)
committerKarl Williamson <khw@cpan.org>
Thu, 2 Mar 2023 00:00:52 +0000 (17:00 -0700)
I had thought that the 's' flag was sufficient for making a function
inline.  But because of PERL_NO_INLINE_FUNCTIONS, the 'i' flag is also
needed.

embed.fnc
proto.h

index 4cac03c..bdd6d1b 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2820,8 +2820,8 @@ Cdp       |void   |save_pushptr   |NULLOK void * const ptr                \
 Cp     |void   |save_pushptrptr|NULLOK void * const ptr1               \
                                |NULLOK void * const ptr2               \
                                |const int type
-Aad  |char * |savepv         |NULLOK const char *pv
-Aad  |char * |savepvn        |NULLOK const char *pv                  \
+Aadip  |char * |savepv         |NULLOK const char *pv
+Aadip  |char * |savepvn        |NULLOK const char *pv                  \
                                |Size_t len
 Cdp    |void   |save_rcpv_free |NN char **ppv
 Cp     |void   |save_re_context
@@ -2837,13 +2837,13 @@ Aadp    |char * |savesharedpvn  |NULLOK const char * const pv           \
                                |const STRLEN len
 Cdp    |void   |save_shared_pvref                                      \
                                |NN char **str
-Aad  |char * |savesharedsvpv |NN SV *sv
+Aadip  |char * |savesharedsvpv |NN SV *sv
 Cp     |void   |save_sptr      |NN SV **sptr
 Cp     |void   |savestack_grow
 Cp     |void   |savestack_grow_cnt                                     \
                                |I32 need
 Xp     |void   |save_strlen    |NN STRLEN *ptr
-Aad  |char * |savesvpv       |NN SV *sv
+Aadip  |char * |savesvpv       |NN SV *sv
 Adhp   |SV *   |save_svref     |NN SV **sptr
 Aopx   |void   |savetmps
 Cdp    |void   |save_vptr      |NN void *ptr
@@ -3782,7 +3782,7 @@ Rp        |int    |PerlSock_socket_cloexec                                \
                                |int protocol
 #endif /* defined(HAS_SOCKET) */
 #if !defined(HAS_STRLCAT)
-ATd  |Size_t |my_strlcat     |NULLOK char *dst                       \
+ATdip  |Size_t |my_strlcat     |NULLOK char *dst                       \
                                |NULLOK const char *src                 \
                                |Size_t size
 #endif /* !defined(HAS_STRLCAT) */
diff --git a/proto.h b/proto.h
index fa4b495..d2c9112 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -4065,18 +4065,6 @@ Perl_save_vptr(pTHX_ void *ptr);
 #define PERL_ARGS_ASSERT_SAVE_VPTR              \
         assert(ptr)
 
-STATIC char *
-Perl_savepv(pTHX_ const char *pv)
-        __attribute__malloc__
-        __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_SAVEPV
-
-STATIC char *
-Perl_savepvn(pTHX_ const char *pv, Size_t len)
-        __attribute__malloc__
-        __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_SAVEPVN
-
 PERL_CALLCONV char *
 Perl_savesharedpv(pTHX_ const char *pv)
         __attribute__malloc__
@@ -4089,13 +4077,6 @@ Perl_savesharedpvn(pTHX_ const char * const pv, const STRLEN len)
         __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_SAVESHAREDPVN
 
-STATIC char *
-Perl_savesharedsvpv(pTHX_ SV *sv)
-        __attribute__malloc__
-        __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_SAVESHAREDSVPV         \
-        assert(sv)
-
 PERL_CALLCONV void
 Perl_savestack_grow(pTHX);
 #define PERL_ARGS_ASSERT_SAVESTACK_GROW
@@ -4104,13 +4085,6 @@ PERL_CALLCONV void
 Perl_savestack_grow_cnt(pTHX_ I32 need);
 #define PERL_ARGS_ASSERT_SAVESTACK_GROW_CNT
 
-STATIC char *
-Perl_savesvpv(pTHX_ SV *sv)
-        __attribute__malloc__
-        __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT_SAVESVPV               \
-        assert(sv)
-
 PERL_CALLCONV void
 Perl_savetmps(pTHX);
 #define PERL_ARGS_ASSERT_SAVETMPS
@@ -5562,12 +5536,6 @@ Perl_PerlSock_socket_cloexec(pTHX_ int domain, int type, int protocol)
 # define PERL_ARGS_ASSERT_PERLSOCK_SOCKET_CLOEXEC
 
 #endif /* defined(HAS_SOCKET) */
-#if !defined(HAS_STRLCAT)
-STATIC Size_t
-Perl_my_strlcat(char *dst, const char *src, Size_t size);
-# define PERL_ARGS_ASSERT_MY_STRLCAT
-
-#endif /* !defined(HAS_STRLCAT) */
 #if !defined(HAS_STRLCPY)
 STATIC Size_t
 Perl_my_strlcpy(char *dst, const char *src, Size_t size);
@@ -9871,6 +9839,32 @@ Perl_newSV_type_mortal(pTHX_ const svtype type)
         __attribute__always_inline__;
 # define PERL_ARGS_ASSERT_NEWSV_TYPE_MORTAL
 
+PERL_STATIC_INLINE char *
+Perl_savepv(pTHX_ const char *pv)
+        __attribute__malloc__
+        __attribute__warn_unused_result__;
+# define PERL_ARGS_ASSERT_SAVEPV
+
+PERL_STATIC_INLINE char *
+Perl_savepvn(pTHX_ const char *pv, Size_t len)
+        __attribute__malloc__
+        __attribute__warn_unused_result__;
+# define PERL_ARGS_ASSERT_SAVEPVN
+
+PERL_STATIC_INLINE char *
+Perl_savesharedsvpv(pTHX_ SV *sv)
+        __attribute__malloc__
+        __attribute__warn_unused_result__;
+# define PERL_ARGS_ASSERT_SAVESHAREDSVPV        \
+        assert(sv)
+
+PERL_STATIC_INLINE char *
+Perl_savesvpv(pTHX_ SV *sv)
+        __attribute__malloc__
+        __attribute__warn_unused_result__;
+# define PERL_ARGS_ASSERT_SAVESVPV              \
+        assert(sv)
+
 PERL_STATIC_INLINE unsigned
 Perl_single_1bit_pos32(U32 word)
         __attribute__warn_unused_result__;
@@ -10041,6 +10035,12 @@ PERL_STATIC_INLINE U8
 Perl_gimme_V(pTHX);
 # define PERL_ARGS_ASSERT_GIMME_V
 
+# if !defined(HAS_STRLCAT)
+PERL_STATIC_INLINE Size_t
+Perl_my_strlcat(char *dst, const char *src, Size_t size);
+#   define PERL_ARGS_ASSERT_MY_STRLCAT
+
+# endif /* !defined(HAS_STRLCAT) */
 # if !defined(HAS_STRNLEN)
 PERL_STATIC_INLINE Size_t
 Perl_my_strnlen(const char *str, Size_t maxlen);