What version of Go are you using (go version)?
go version go1.14.2 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
// skipping
What did you do?
package main
func main() {
thing := make([]byte, 65536) // also ran with 65535, which is < 64KiB
}
Ran with go run -gcflags '-m -m' alloc.go
What did you expect to see?
message should say it escapes to heap because of a max value (not sure if this is an escape analysis impl determined value, or more related to my architecture or setup of the stack, or a mix of those)
What did you see instead?
./alloc.go:7:13: make([]byte, 65537) escapes to heap:
./alloc.go:7:13: flow: {heap} = &{storage for make([]byte, 65537)}:
./alloc.go:7:13: from make([]byte, 65537) (non-constant size) at ./alloc.go:7:13
it will not escape when I use 65535 instead of 65536.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env)?// skipping
What did you do?
Ran with
go run -gcflags '-m -m' alloc.goWhat did you expect to see?
message should say it escapes to heap because of a max value (not sure if this is an escape analysis impl determined value, or more related to my architecture or setup of the stack, or a mix of those)
What did you see instead?
it will not escape when I use
65535instead of65536.