aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.goc
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2012-10-15 13:54:31 +0400
committerDmitriy Vyukov <dvyukov@google.com>2012-10-15 13:54:31 +0400
commit6273c7324fa671f8e8e43c0113e842d2ab5fe8b9 (patch)
treedba9794563b865dc2423c5b9b947602a112b33ad /src/pkg/runtime/malloc.goc
parent1f31598e863addd9fe0ddb09f11d2420996cc292 (diff)
downloadgo-6273c7324fa671f8e8e43c0113e842d2ab5fe8b9.tar.xz
runtime: add missing if(raceenabled)
R=0xe2.0x9a.0x9b, minux.ma, iant, dave CC=golang-dev https://golang.org/cl/6654052
Diffstat (limited to 'src/pkg/runtime/malloc.goc')
-rw-r--r--src/pkg/runtime/malloc.goc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.goc b/src/pkg/runtime/malloc.goc
index 92bc4aa234..9b74b1040e 100644
--- a/src/pkg/runtime/malloc.goc
+++ b/src/pkg/runtime/malloc.goc
@@ -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);