Source file src/internal/abi/map_select_swiss.go

     1  // Copyright 2024 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  //go:build goexperiment.swissmap
     6  
     7  package abi
     8  
     9  // Select the map type that this binary is built using. This is for common
    10  // lookup methods like Type.Key to know which type to use.
    11  //
    12  // Note that mapType *must not be used by any functions called in the
    13  // compiler to build a target program* because the compiler must use the map
    14  // type determined by run-time GOEXPERIMENT, not the build tags used to build
    15  // the compiler.
    16  //
    17  // TODO(prattmic): This package is rather confusing because it has many
    18  // functions that can't be used by the compiler (e.g., Type.Uncommon depends on
    19  // the layout of type + uncommon objects in the binary. It would be incorrect
    20  // for an ad-hoc local Type object). It may be best to move code that isn't
    21  // usable by the compiler out of the package.
    22  type mapType = SwissMapType
    23  

View as plain text