From 3877f1d9c80f57beb8a8dde778f6239598fd4a58 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Tue, 11 Mar 2014 17:35:49 +0400 Subject: [PATCH] runtime: remove atomic CAS loop from marknogc Spans are now private to threads, and the loop is removed from all other functions. Remove it from marknogc for consistency. LGTM=khr, rsc R=golang-codereviews, bradfitz, khr CC=golang-codereviews, khr, rsc https://golang.org/cl/72520043 --- src/pkg/runtime/mgc0.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c index 3c74417893..0bb2badde5 100644 --- a/src/pkg/runtime/mgc0.c +++ b/src/pkg/runtime/mgc0.c @@ -2614,26 +2614,12 @@ runfinq(void) void runtime·marknogc(void *v) { - uintptr *b, obits, bits, off, shift; + uintptr *b, off, shift; off = (uintptr*)v - (uintptr*)runtime·mheap.arena_start; // word offset b = (uintptr*)runtime·mheap.arena_start - off/wordsPerBitmapWord - 1; shift = off % wordsPerBitmapWord; - - for(;;) { - obits = *b; - if((obits>>shift & bitMask) != bitAllocated) - runtime·throw("bad initial state for marknogc"); - bits = (obits & ~(bitAllocated<