Commit fa462834 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: remove unused m->racepc

The original plan was to collect allocation stacks
for all memory blocks. But it was never implemented
and it's not in near plans and it's unclear how to do it at all.

R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/12724044
parent f3c1070f
...@@ -141,10 +141,8 @@ runtime·mallocgc(uintptr size, uintptr typ, uint32 flag) ...@@ -141,10 +141,8 @@ runtime·mallocgc(uintptr size, uintptr typ, uint32 flag)
if(!(flag & FlagNoInvokeGC) && mstats.heap_alloc >= mstats.next_gc) if(!(flag & FlagNoInvokeGC) && mstats.heap_alloc >= mstats.next_gc)
runtime·gc(0); runtime·gc(0);
if(raceenabled) { if(raceenabled)
runtime·racemalloc(v, size, m->racepc); runtime·racemalloc(v, size);
m->racepc = nil;
}
return v; return v;
} }
...@@ -702,8 +700,6 @@ runtime·mal(uintptr n) ...@@ -702,8 +700,6 @@ runtime·mal(uintptr n)
void void
runtime·new(Type *typ, uint8 *ret) runtime·new(Type *typ, uint8 *ret)
{ {
if(raceenabled)
m->racepc = runtime·getcallerpc(&typ);
ret = runtime·mallocgc(typ->size, (uintptr)typ | TypeInfo_SingleObject, typ->kind&KindNoPointers ? FlagNoPointers : 0); ret = runtime·mallocgc(typ->size, (uintptr)typ | TypeInfo_SingleObject, typ->kind&KindNoPointers ? FlagNoPointers : 0);
FLUSH(&ret); FLUSH(&ret);
} }
......
...@@ -138,13 +138,13 @@ runtime·racefuncexit(void) ...@@ -138,13 +138,13 @@ runtime·racefuncexit(void)
} }
void void
runtime·racemalloc(void *p, uintptr sz, void *pc) runtime·racemalloc(void *p, uintptr sz)
{ {
// use m->curg because runtime·stackalloc() is called from g0 // use m->curg because runtime·stackalloc() is called from g0
if(m->curg == nil) if(m->curg == nil)
return; return;
m->racecall = true; m->racecall = true;
runtimerace·Malloc(m->curg->racectx, p, sz, pc); runtimerace·Malloc(m->curg->racectx, p, sz, /* unused pc */ 0);
m->racecall = false; m->racecall = false;
} }
......
...@@ -16,7 +16,7 @@ uintptr runtime·raceinit(void); ...@@ -16,7 +16,7 @@ uintptr runtime·raceinit(void);
void runtime·racefini(void); void runtime·racefini(void);
void runtime·racemapshadow(void *addr, uintptr size); void runtime·racemapshadow(void *addr, uintptr size);
void runtime·racemalloc(void *p, uintptr sz, void *pc); void runtime·racemalloc(void *p, uintptr sz);
void runtime·racefree(void *p); void runtime·racefree(void *p);
uintptr runtime·racegostart(void *pc); uintptr runtime·racegostart(void *pc);
void runtime·racegoend(void); void runtime·racegoend(void);
......
...@@ -105,11 +105,10 @@ runtime·racefingo(void) ...@@ -105,11 +105,10 @@ runtime·racefingo(void)
} }
void void
runtime·racemalloc(void *p, uintptr sz, void *pc) runtime·racemalloc(void *p, uintptr sz)
{ {
USED(p); USED(p);
USED(sz); USED(sz);
USED(pc);
} }
void void
......
...@@ -339,7 +339,6 @@ struct M ...@@ -339,7 +339,6 @@ struct M
GCStats gcstats; GCStats gcstats;
bool racecall; bool racecall;
bool needextram; bool needextram;
void* racepc;
void (*waitunlockf)(Lock*); void (*waitunlockf)(Lock*);
void* waitlock; void* waitlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment