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)
if(!(flag & FlagNoInvokeGC) && mstats.heap_alloc >= mstats.next_gc)
runtime·gc(0);
if(raceenabled) {
runtime·racemalloc(v, size, m->racepc);
m->racepc = nil;
}
if(raceenabled)
runtime·racemalloc(v, size);
return v;
}
......@@ -702,8 +700,6 @@ runtime·mal(uintptr n)
void
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);
FLUSH(&ret);
}
......
......@@ -138,13 +138,13 @@ runtime·racefuncexit(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
if(m->curg == nil)
return;
m->racecall = true;
runtimerace·Malloc(m->curg->racectx, p, sz, pc);
runtimerace·Malloc(m->curg->racectx, p, sz, /* unused pc */ 0);
m->racecall = false;
}
......
......@@ -16,7 +16,7 @@ uintptr runtime·raceinit(void);
void runtime·racefini(void);
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);
uintptr runtime·racegostart(void *pc);
void runtime·racegoend(void);
......
......@@ -105,11 +105,10 @@ runtime·racefingo(void)
}
void
runtime·racemalloc(void *p, uintptr sz, void *pc)
runtime·racemalloc(void *p, uintptr sz)
{
USED(p);
USED(sz);
USED(pc);
}
void
......
......@@ -339,7 +339,6 @@ struct M
GCStats gcstats;
bool racecall;
bool needextram;
void* racepc;
void (*waitunlockf)(Lock*);
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