Created
November 22, 2023 10:03
-
-
Save yumed15/a6a7c0125ee270b6ef48143c7662e5d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
func main() { | |
const constSize = 10 | |
var varSize = 10 | |
s1 := []int32{} | |
// s2 escapes to heap: non-constant size | |
s2 := make([]int32, varSize) | |
s3 := make([]int32, constSize) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment