]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/mgc0.c
[dev.power64] all: merge default (dd5014ed9b01) into dev.power64
[gostls13.git] / src / runtime / mgc0.c
index 1b41bf9a79419627c791092102922c05e737f57b..e5b6870c668d8a5887d9924a928aee7277a2b05c 100644 (file)
@@ -65,7 +65,7 @@
 enum {
        Debug           = 0,
        DebugPtrs       = 0, // if 1, print trace of every pointer load during GC
-       ConcurrentSweep = 1,
+       ConcurrentSweep = 0,
 
        WorkbufSize     = 4*1024,
        FinBlockSize    = 4*1024,
@@ -1784,7 +1784,7 @@ runtime·unrollgcprog_m(void)
        Type *typ;
        byte *mask, *prog;
        uintptr pos;
-       uint32 x;
+       uintptr x;
 
        typ = g->m->ptrarg[0];
        g->m->ptrarg[0] = nil;
@@ -1802,9 +1802,11 @@ runtime·unrollgcprog_m(void)
                        prog = (byte*)typ->gc[1];
                        unrollgcprog1(mask, prog, &pos, false, true);
                }
+               
                // atomic way to say mask[0] = 1
-               x = ((uint32*)mask)[0];
-               runtime·atomicstore((uint32*)mask, x|1);
+               x = *(uintptr*)mask;
+               ((byte*)&x)[0] = 1;
+               runtime·atomicstorep((void**)mask, (void*)x);
        }
        runtime·unlock(&lock);
 }