]> Cypherpunks repositories - gostls13.git/commitdiff
runtime, runtime/race: add missing if(raceenabled), update package docs of pkg race
authorShenghou Ma <minux.ma@gmail.com>
Mon, 22 Oct 2012 18:33:51 +0000 (02:33 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Mon, 22 Oct 2012 18:33:51 +0000 (02:33 +0800)
R=dvyukov
CC=golang-dev
https://golang.org/cl/6733058

src/pkg/runtime/malloc.goc
src/pkg/runtime/race/race.go

index eaae52a64185a245a8fc6e54a8b8ac14d283e04e..f8aa1c949e7a20e48c77f2ec87db4e723d52aa68 100644 (file)
@@ -715,7 +715,8 @@ runtime·cnew(Type *typ)
        uint32 flag;
        void *ret;
 
-       m->racepc = runtime·getcallerpc(&typ);
+       if(raceenabled)
+               m->racepc = runtime·getcallerpc(&typ);
        flag = typ->kind&KindNoPointers ? FlagNoPointers : 0;
        ret = runtime·mallocgc(typ->size, flag, 1, 1);
 
index ddeff5de763eba12799c98fbff0673f4fc6a9362..f3a7be50c6dfc14019fd1cb813b2c59f5f27b303 100644 (file)
@@ -4,7 +4,7 @@
 
 // +build race,linux,amd64 race,darwin,amd64
 
-// Data race detection.
+// Package race provides low-level facilities for data race detection.
 package race
 
 /*