]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use memmove rather than memcopy in mgc0.c
authorIan Lance Taylor <iant@golang.org>
Tue, 5 Aug 2014 03:40:44 +0000 (20:40 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 5 Aug 2014 03:40:44 +0000 (20:40 -0700)
For consistency with other code, as that was the only use of
memcopy outside of alg.goc.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/122030044

src/pkg/runtime/mgc0.c

index c46dec4105967958ba058b7fca820a404faa8c5d..d2a87edd14320afab5d7ce3e051348bd88f7e7bb 100644 (file)
@@ -1515,7 +1515,7 @@ runtime·ReadMemStats(MStats *stats)
        runtime·updatememstats(nil);
        // Size of the trailing by_size array differs between Go and C,
        // NumSizeClasses was changed, but we can not change Go struct because of backward compatibility.
-       runtime·memcopy(runtime·sizeof_C_MStats, stats, &mstats);
+       runtime·memmove(stats, &mstats, runtime·sizeof_C_MStats);
 
        // Stack numbers are part of the heap numbers, separate those out for user consumption
        stats->stacks_sys = stats->stacks_inuse;