runtime: replace runtime.mcpy with runtime.memmove

faster string operations, and more

tested on linux/386

runtime_test.BenchmarkSliceToString                    642          532  -17.13%
runtime_test.BenchmarkStringToSlice                    636          528  -16.98%
runtime_test.BenchmarkConcatString                    1109          897  -19.12%

R=r, iant, rsc
CC=golang-dev
https://golang.org/cl/4674042
This commit is contained in:
Quan Yong Zhai 2011-07-12 17:30:40 -07:00 committed by Russ Cox
parent ba91dac3a9
commit fe9991e8b2
13 changed files with 22 additions and 57 deletions

View file

@ -708,7 +708,7 @@ void
·_Cfunc_CString(String s, int8 *p)
{
p = runtime·cmalloc(s.len+1);
runtime·mcpy((byte*)p, s.str, s.len);
runtime·memmove((byte*)p, s.str, s.len);
p[s.len] = 0;
FLUSH(&p);
}