Source file src/runtime/tagptr.go

     1  // Copyright 2023 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  package runtime
     6  
     7  // taggedPointer is a pointer with a numeric tag.
     8  // The size of the numeric tag is GOARCH-dependent,
     9  // currently at least 16 bits.
    10  // This should only be used with pointers allocated outside the Go heap.
    11  type taggedPointer uint64
    12  
    13  // minTagBits is the minimum number of tag bits that we expect.
    14  const minTagBits = 16
    15  
    16  // # of bits we can steal from the bottom. We enforce that all pointers
    17  // that we tag are aligned to at least this many bits.
    18  // Currently the long pole in this tent is pollDesc at 280 bytes. Setting
    19  // 9 here rounds those structs up to 512 bytes.
    20  // gcBgMarkWorkerNode is also small, but we don't make many of those
    21  // so it is ok to waste space on them.
    22  const tagAlignBits = 9
    23  const tagAlign = 1 << tagAlignBits
    24  

View as plain text