github.com/cockroachdb/pebble@v1.1.1-0.20240513155919-3622ade60459/internal/constants/constants.go (about) 1 // Copyright 2023 The LevelDB-Go and Pebble Authors. All rights reserved. Use 2 // of this source code is governed by a BSD-style license that can be found in 3 // the LICENSE file. 4 5 package constants 6 7 const ( 8 // oneIf64Bit is 1 on 64-bit platforms and 0 on 32-bit platforms. 9 oneIf64Bit = ^uint(0) >> 63 10 11 // MaxUint32OrInt returns min(MaxUint32, MaxInt), i.e 12 // - MaxUint32 on 64-bit platforms; 13 // - MaxInt on 32-bit platforms. 14 // It is used when slices are limited to Uint32 on 64-bit platforms (the 15 // length limit for slices is naturally MaxInt on 32-bit platforms). 16 MaxUint32OrInt = (1<<31)<<oneIf64Bit - 1 17 )