Commit 01ab9a01 authored by Jan Ziak's avatar Jan Ziak Committed by Russ Cox

runtime: improve precision of GC_REGION

R=rsc
CC=golang-dev
https://golang.org/cl/7383054
parent 5a09f1b3
...@@ -546,7 +546,7 @@ static void ...@@ -546,7 +546,7 @@ static void
scanblock(Workbuf *wbuf, Obj *wp, uintptr nobj, bool keepworking) scanblock(Workbuf *wbuf, Obj *wp, uintptr nobj, bool keepworking)
{ {
byte *b, *arena_start, *arena_used; byte *b, *arena_start, *arena_used;
uintptr n, i, end_b, elemsize, ti, objti, count, type; uintptr n, i, end_b, elemsize, size, ti, objti, count, type;
uintptr *pc, precise_type, nominal_size; uintptr *pc, precise_type, nominal_size;
uintptr *map_ret, mapkey_size, mapval_size, mapkey_ti, mapval_ti; uintptr *map_ret, mapkey_size, mapval_size, mapkey_ti, mapval_ti;
void *obj; void *obj;
...@@ -905,9 +905,14 @@ scanblock(Workbuf *wbuf, Obj *wp, uintptr nobj, bool keepworking) ...@@ -905,9 +905,14 @@ scanblock(Workbuf *wbuf, Obj *wp, uintptr nobj, bool keepworking)
continue; continue;
case GC_REGION: case GC_REGION:
// TODO(atom): to be expanded in a next CL. Same as GC_APTR for now.
obj = (void*)(stack_top.b + pc[1]); obj = (void*)(stack_top.b + pc[1]);
size = pc[2];
objti = pc[3];
pc += 4; pc += 4;
*objbufpos++ = (Obj){obj, size, objti};
if(objbufpos == objbuf_end)
flushobjbuf(objbuf, &objbufpos, &wp, &wbuf, &nobj);
break; break;
case GC_CHAN: case GC_CHAN:
......
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