package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev
# Functions
EstimateBucketMemoryUsage returns the estimated memory usage of a bucket in a map.
GetBytesFromPtr return a bytes array from the given ptr and length.
Slice converts string to slice without copy.
String converts slice to MutableString without copy.
# Constants
DefBucketMemoryUsageForMapIntToPtr = bucketSize*(1+unsafe.Sizeof(uint64) + unsafe.Sizeof(pointer))+2*ptrSize.
DefBucketMemoryUsageForMapStringToAny = bucketSize*(1+unsafe.Sizeof(string) + unsafe.Sizeof(interface{}))+2*ptrSize.
DefBucketMemoryUsageForMapStrToSlice = bucketSize*(1+unsafe.Sizeof(string) + unsafe.Sizeof(slice))+2*ptrSize ref https://github.com/golang/go/blob/go1.15.6/src/reflect/type.go#L2162.
DefBucketMemoryUsageForSetFloat64 = bucketSize*(1+unsafe.Sizeof(float64) + unsafe.Sizeof(struct{}))+2*ptrSize.
DefBucketMemoryUsageForSetInt64 = bucketSize*(1+unsafe.Sizeof(int64) + unsafe.Sizeof(struct{}))+2*ptrSize.
DefBucketMemoryUsageForSetString = bucketSize*(1+unsafe.Sizeof(string) + unsafe.Sizeof(struct{}))+2*ptrSize.
LoadFactorDen is the denominator of load factor.
# Variables
LoadFactorNum is the numerator of load factor.
# Type aliases
MutableString can be used as string via string(MutableString) without performance loss.