summaryrefslogtreecommitdiff
path: root/embed.fnc
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 /embed.fnc
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 'embed.fnc')
-rw-r--r--embed.fnc2
1 files changed, 1 insertions, 1 deletions
diff --git a/embed.fnc b/embed.fnc
index f2c7050a3a..74cc6049f1 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -860,7 +860,7 @@ EXp |SV*|reg_qr_package|NN REGEXP * const rx
: FIXME - why the E?
Ep |void |regprop |NULLOK const regexp *prog|NN SV* sv|NN const regnode* o
-Ap |void |repeatcpy |NN char* to|NN const char* from|I32 len|I32 count
+Anp |void |repeatcpy |NN char* to|NN const char* from|I32 len|I32 count
AnpP |char* |rninstr |NN const char* big|NN const char* bigend \
|NN const char* little|NN const char* lend
Ap |Sighandler_t|rsignal |int i|Sighandler_t t