This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Request function to be inline
authorKarl Williamson <public@khwilliamson.com>
Fri, 7 Sep 2012 17:20:49 +0000 (11:20 -0600)
committerKarl Williamson <public@khwilliamson.com>
Tue, 20 Nov 2012 00:12:59 +0000 (17:12 -0700)
This could remove a layer of function call overhead for this small
function, (if the compiler doesn't already choose to inline it).

embed.fnc
proto.h
utf8.c

index 43eae25..814495f 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2219,7 +2219,7 @@ sn        |NV|mulexp10    |NV value|I32 exponent
 #if defined(PERL_IN_UTF8_C)
 sRn    |STRLEN |is_utf8_char_slow|NN const U8 *s|const STRLEN len
 sRM    |UV     |check_locale_boundary_crossing|NN const U8* const p|const UV result|NN U8* const ustrp|NN STRLEN *lenp
-sR     |bool   |is_utf8_common |NN const U8 *const p|NN SV **swash|NN const char * const swashname
+iR     |bool   |is_utf8_common |NN const U8 *const p|NN SV **swash|NN const char * const swashname
 sR     |SV*    |swatch_get     |NN SV* swash|UV start|UV span
 #endif
 
diff --git a/proto.h b/proto.h
index 43f87d1..b044718 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -7246,7 +7246,7 @@ STATIC STRLEN     S_is_utf8_char_slow(const U8 *s, const STRLEN len)
 #define PERL_ARGS_ASSERT_IS_UTF8_CHAR_SLOW     \
        assert(s)
 
-STATIC bool    S_is_utf8_common(pTHX_ const U8 *const p, SV **swash, const char * const swashname)
+PERL_STATIC_INLINE bool        S_is_utf8_common(pTHX_ const U8 *const p, SV **swash, const char * const swashname)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
diff --git a/utf8.c b/utf8.c
index ed2cfab..76d0331 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -1930,7 +1930,7 @@ Perl_to_uni_lower_lc(pTHX_ U32 c)
     return (U32)to_uni_lower(c, tmpbuf, &len);
 }
 
-static bool
+PERL_STATIC_INLINE bool
 S_is_utf8_common(pTHX_ const U8 *const p, SV **swash,
                 const char *const swashname)
 {