This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Rewrite and inline my_strnlen()
authorKarl Williamson <khw@cpan.org>
Sun, 12 Jan 2020 17:11:54 +0000 (10:11 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 14 Jan 2020 03:54:05 +0000 (20:54 -0700)
commit1ab100a8598da3fcda1b313c7a6415231a170eea
tree959c120e5f7b9c16d9612819836d054fb74cdae9
parent7bea1fb03caa036528182ef907f72095b5d91dea
Rewrite and inline my_strnlen()

This commit changes this function to use memchr() instead of looping
byte-by-byte through the string.  And it inlines it into 3 lines of
code.  This should give comparable performance to a native libc
strnlen().
embed.fnc
inline.h
proto.h
util.c