summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2009-08-27 11:13:09 +0200
committerVincent Pit <perl@profvince.com>2009-08-27 12:54:36 +0200
commit16fa5c119c4bda5c0396a5f81296bd1ccc128a9c (patch)
treeae140159521df8110da72f27f01bb505664cb83c /proto.h
parent04c9e624265a2bf3bdeecd0310e754b5ecc8bbeb (diff)
downloadperl-16fa5c119c4bda5c0396a5f81296bd1ccc128a9c.tar.gz
Speed up repeatcpy() by at least 40% for 1-char or numerous repeats
And don't make it receive the interpreter anymore. For 1-char repeats, use memset(). Otherwise, use the old implementation up to some (small) length, and then use memcpy() in a binary manner, based on what we previously copied. Note that we use memcpy() so both strings shouldn't overlap. The previous implementation didn't allow this as well. This would be a good place to use the restrict keyword from C99. I'm not sure if Configure has a probe for it.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/proto.h b/proto.h
index cb04ab84e5..9734b14d35 100644
--- a/proto.h
+++ b/proto.h
@@ -2665,9 +2665,9 @@ PERL_CALLCONV void Perl_regprop(pTHX_ const regexp *prog, SV* sv, const regnode*
#define PERL_ARGS_ASSERT_REGPROP \
assert(sv); assert(o)
-PERL_CALLCONV void Perl_repeatcpy(pTHX_ char* to, const char* from, I32 len, I32 count)
- __attribute__nonnull__(pTHX_1)
- __attribute__nonnull__(pTHX_2);
+PERL_CALLCONV void Perl_repeatcpy(char* to, const char* from, I32 len, I32 count)
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
#define PERL_ARGS_ASSERT_REPEATCPY \
assert(to); assert(from)