# command-line-arguments ./main.go:17:6: can inline NewRectangle ./main.go:24:6: can inline (*Rectangle).Area ./main.go:7:20: inlining call to NewRectangle ./main.go:8:21: inlining call to (*Rectangle).Area ./main.go:8:14: inlining call to fmt.Println ./main.go:8:14: ... argument does not escape ./main.go:8:21: ~R0 escapes to heap ./main.go:24:7: r does not escape 最適化によりインライン展開している スタックにあります
./main.go:17:6: can inline NewRectangle ./main.go:24:6: can inline (*Rectangle).Area ./main.go:7:20: inlining call to NewRectangle ./main.go:8:21: inlining call to (*Rectangle).Area ./main.go:8:14: inlining call to fmt.Println ./main.go:7:20: &Rectangle{...} does not escape ./main.go:8:14: ... argument does not escape ./main.go:8:21: ~R0 escapes to heap ./main.go:18:9: &Rectangle{...} escapes to heap ./main.go:24:7: r does not escape ※この例では実際にはインラインされているので影響はない 関数の戻り値はヒープ に渡されます インライン展開されたもの はスタックにあります