Source file src/runtime/align_runtime_test.go

     1  // Copyright 2022 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // This file lives in the runtime package
     6  // so we can get access to the runtime guts.
     7  // The rest of the implementation of this test is in align_test.go.
     8  
     9  package runtime
    10  
    11  import "unsafe"
    12  
    13  // AtomicFields is the set of fields on which we perform 64-bit atomic
    14  // operations (all the *64 operations in runtime/internal/atomic).
    15  var AtomicFields = []uintptr{
    16  	unsafe.Offsetof(m{}.procid),
    17  	unsafe.Offsetof(p{}.timer0When),
    18  	unsafe.Offsetof(p{}.timerModifiedEarliest),
    19  	unsafe.Offsetof(p{}.gcFractionalMarkTime),
    20  	unsafe.Offsetof(schedt{}.goidgen),
    21  	unsafe.Offsetof(schedt{}.lastpoll),
    22  	unsafe.Offsetof(schedt{}.pollUntil),
    23  	unsafe.Offsetof(schedt{}.timeToRun),
    24  	unsafe.Offsetof(gcControllerState{}.bgScanCredit),
    25  	unsafe.Offsetof(gcControllerState{}.maxStackScan),
    26  	unsafe.Offsetof(gcControllerState{}.heapLive),
    27  	unsafe.Offsetof(gcControllerState{}.heapScan),
    28  	unsafe.Offsetof(gcControllerState{}.dedicatedMarkTime),
    29  	unsafe.Offsetof(gcControllerState{}.dedicatedMarkWorkersNeeded),
    30  	unsafe.Offsetof(gcControllerState{}.fractionalMarkTime),
    31  	unsafe.Offsetof(gcControllerState{}.idleMarkTime),
    32  	unsafe.Offsetof(gcControllerState{}.globalsScan),
    33  	unsafe.Offsetof(gcControllerState{}.lastStackScan),
    34  	unsafe.Offsetof(timeHistogram{}.underflow),
    35  	unsafe.Offsetof(profBuf{}.overflow),
    36  	unsafe.Offsetof(profBuf{}.overflowTime),
    37  	unsafe.Offsetof(heapStatsDelta{}.tinyAllocCount),
    38  	unsafe.Offsetof(heapStatsDelta{}.smallAllocCount),
    39  	unsafe.Offsetof(heapStatsDelta{}.smallFreeCount),
    40  	unsafe.Offsetof(heapStatsDelta{}.largeAlloc),
    41  	unsafe.Offsetof(heapStatsDelta{}.largeAllocCount),
    42  	unsafe.Offsetof(heapStatsDelta{}.largeFree),
    43  	unsafe.Offsetof(heapStatsDelta{}.largeFreeCount),
    44  	unsafe.Offsetof(heapStatsDelta{}.committed),
    45  	unsafe.Offsetof(heapStatsDelta{}.released),
    46  	unsafe.Offsetof(heapStatsDelta{}.inHeap),
    47  	unsafe.Offsetof(heapStatsDelta{}.inStacks),
    48  	unsafe.Offsetof(heapStatsDelta{}.inPtrScalarBits),
    49  	unsafe.Offsetof(heapStatsDelta{}.inWorkBufs),
    50  	unsafe.Offsetof(lfnode{}.next),
    51  	unsafe.Offsetof(mstats{}.last_gc_nanotime),
    52  	unsafe.Offsetof(mstats{}.last_gc_unix),
    53  	unsafe.Offsetof(mstats{}.gcPauseDist),
    54  	unsafe.Offsetof(ticksType{}.val),
    55  	unsafe.Offsetof(workType{}.bytesMarked),
    56  	unsafe.Offsetof(timeHistogram{}.counts),
    57  }
    58  
    59  // AtomicVariables is the set of global variables on which we perform
    60  // 64-bit atomic operations.
    61  var AtomicVariables = []unsafe.Pointer{
    62  	unsafe.Pointer(&ncgocall),
    63  	unsafe.Pointer(&test_z64),
    64  	unsafe.Pointer(&blockprofilerate),
    65  	unsafe.Pointer(&mutexprofilerate),
    66  	unsafe.Pointer(&gcController),
    67  	unsafe.Pointer(&memstats),
    68  	unsafe.Pointer(&sched),
    69  	unsafe.Pointer(&ticks),
    70  	unsafe.Pointer(&work),
    71  }
    72  

View as plain text