In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/fb387a96f609c00a517aa640d941f26f1e52f15a?hp=1e67156061b1f7aa186cda226e8470dfa1c5a681>
- Log ----------------------------------------------------------------- commit fb387a96f609c00a517aa640d941f26f1e52f15a Author: Karl Williamson <[email protected]> Date: Wed Jan 4 22:41:53 2017 -0700 regcomp.c: Use memEQ instead of looping an element at a time M regcomp.c commit d8732c60696bbb69e2a8d8d28eed06f5eb2034a6 Author: Karl Williamson <[email protected]> Date: Wed Jan 4 22:25:15 2017 -0700 perlapi: Add clarification for SvGROW() M sv.h commit 7a7d14f32842bc6e1bfe10da953175395f67b4e2 Author: Karl Williamson <[email protected]> Date: Wed Jan 4 22:18:24 2017 -0700 toke.c: Make too-long inline function just static This function is too long to be effectively inlined, so don't request the compiler to do so. M embed.fnc M proto.h M toke.c commit 4b31b634f714aca0e8d52b4081eadb551c8efe0d Author: Karl Williamson <[email protected]> Date: Wed Jan 4 22:16:08 2017 -0700 utf8.c: Add a const to a function parameter M embed.fnc M proto.h M utf8.c ----------------------------------------------------------------------- Summary of changes: embed.fnc | 4 ++-- proto.h | 4 ++-- regcomp.c | 15 ++------------- sv.h | 3 +++ toke.c | 2 +- utf8.c | 2 +- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/embed.fnc b/embed.fnc index 66cbee8b6c..656afe569f 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1817,7 +1817,7 @@ Ap |UV |utf8n_to_uvuni|NN const U8 *s|STRLEN curlen|NULLOK STRLEN *retlen|U32 fl Adm |U8* |uvchr_to_utf8 |NN U8 *d|UV uv Ap |U8* |uvuni_to_utf8 |NN U8 *d|UV uv Adm |U8* |uvchr_to_utf8_flags |NN U8 *d|UV uv|UV flags -Apd |U8* |uvoffuni_to_utf8_flags |NN U8 *d|UV uv|UV flags +Apd |U8* |uvoffuni_to_utf8_flags |NN U8 *d|UV uv|const UV flags Ap |U8* |uvuni_to_utf8_flags |NN U8 *d|UV uv|UV flags Apd |char* |pv_uni_display |NN SV *dsv|NN const U8 *spv|STRLEN len|STRLEN pvlim|UV flags ApdR |char* |sv_uni_display |NN SV *dsv|NN SV *ssv|STRLEN pvlim|UV flags @@ -2640,7 +2640,7 @@ s |char* |force_word |NN char *start|int token|int check_keyword \ |int allow_pack s |SV* |tokeq |NN SV *sv sR |char* |scan_const |NN char *start -iR |SV* |get_and_check_backslash_N_name|NN const char* s \ +sR |SV* |get_and_check_backslash_N_name|NN const char* s \ |NN const char* const e sR |char* |scan_formline |NN char *s sR |char* |scan_heredoc |NN char *s diff --git a/proto.h b/proto.h index cc9a5840f5..2fd8a51580 100644 --- a/proto.h +++ b/proto.h @@ -3574,7 +3574,7 @@ PERL_CALLCONV void Perl_utilize(pTHX_ int aver, I32 floor, OP* version, OP* idop assert(idop) /* PERL_CALLCONV U8* uvchr_to_utf8(pTHX_ U8 *d, UV uv); */ /* PERL_CALLCONV U8* uvchr_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags); */ -PERL_CALLCONV U8* Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags); +PERL_CALLCONV U8* Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, const UV flags); #define PERL_ARGS_ASSERT_UVOFFUNI_TO_UTF8_FLAGS \ assert(d) PERL_CALLCONV U8* Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv); @@ -5506,7 +5506,7 @@ STATIC char* S_force_version(pTHX_ char *s, int guessing); STATIC char* S_force_word(pTHX_ char *start, int token, int check_keyword, int allow_pack); #define PERL_ARGS_ASSERT_FORCE_WORD \ assert(start) -PERL_STATIC_INLINE SV* S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e) +STATIC SV* S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e) __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_GET_AND_CHECK_BACKSLASH_N_NAME \ assert(s); assert(e) diff --git a/regcomp.c b/regcomp.c index 953a94d45f..7b312952de 100644 --- a/regcomp.c +++ b/regcomp.c @@ -10101,20 +10101,9 @@ Perl__invlistEQ(pTHX_ SV* const a, SV* const b, const bool complement_b) } } - /* Make sure that the lengths are the same, as well as the final element - * before looping through the remainder. (Thus we test the length, final, - * and first elements right off the bat) */ - if (len_a != len_b || array_a[len_a-1] != array_b[len_a-1]) { - retval = FALSE; - } - else for (i = 0; i < len_a - 1; i++) { - if (array_a[i] != array_b[i]) { - retval = FALSE; - break; - } - } + return len_a == len_b + && memEQ(array_a, array_b, len_a * sizeof(array_a[0])); - return retval; } #endif diff --git a/sv.h b/sv.h index e311ff2c02..6227d46a0a 100644 --- a/sv.h +++ b/sv.h @@ -2013,6 +2013,9 @@ Returns a pointer to the character buffer. SV must be of type >= C<SVt_PV>. One alternative is to call C<sv_grow> if you are not sure of the type of SV. +You might mistakenly think that C<len> is the number of bytes to add to the +existing size, but instead it is the total size C<sv> should be. + =for apidoc Am|char *|SvPVCLEAR|SV* sv Ensures that sv is a SVt_PV and that its SvCUR is 0, and that it is properly null terminated. Equivalent to sv_setpvs(""), but more efficient. diff --git a/toke.c b/toke.c index c0e3e273bf..e6dad0a21e 100644 --- a/toke.c +++ b/toke.c @@ -2543,7 +2543,7 @@ S_sublex_done(pTHX) } } -PERL_STATIC_INLINE SV* +STATIC SV* S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e) { /* <s> points to first character of interior of \N{}, <e> to one beyond the diff --git a/utf8.c b/utf8.c index fd965f8638..ed5b027afe 100644 --- a/utf8.c +++ b/utf8.c @@ -146,7 +146,7 @@ For details, see the description for L</uvchr_to_utf8_flags>. #define MASK UTF_CONTINUATION_MASK U8 * -Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags) +Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, const UV flags) { PERL_ARGS_ASSERT_UVOFFUNI_TO_UTF8_FLAGS; -- Perl5 Master Repository
