mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
ba91dac3a9
commit
fe9991e8b2
13 changed files with 22 additions and 57 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue