]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add missing if(raceenabled)
authorDmitriy Vyukov <dvyukov@google.com>
Mon, 15 Oct 2012 09:54:31 +0000 (13:54 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Mon, 15 Oct 2012 09:54:31 +0000 (13:54 +0400)
R=0xe2.0x9a.0x9b, minux.ma, iant, dave
CC=golang-dev
https://golang.org/cl/6654052

src/pkg/runtime/malloc.goc

index 92bc4aa234373a9f66b749693037c4273f4b4d56..9b74b1040e91420799896c5d05e21dfe85a4ea55 100644 (file)
@@ -693,7 +693,8 @@ runtime·new(Type *typ, uint8 *ret)
 {
        uint32 flag;
 
-       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);