Why is the output of the golang unsafe.Sizeof () string 8 bytes under windows?

the following code shows that the output in a linux-like operating system is 16 bytes, which is the same as officially, but in a windows environment, the output is 8 bytes? Excuse me, why is this?

package main

import (
    "fmt"
    "unsafe"
)

func main() {
    var a = "hello world"
    fmt.Print(unsafe.Sizeof(a))
}
Jul.26,2021

you should install a 32-bit version under windows and a 64-bit version under linux, resulting in this difference. For a string, the 32-bit version will return 8-bit version and the 64-bit version will return 16.


the occupied space of a string should be a uintptr pointer plus the length of the string int , Windows32 bit version is 4x4 and Windows32 64-bit version is 8room8

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b39274-2c17a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b39274-2c17a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?