On Fri, Apr 13, 2018 at 2:07 PM, Yulrizka wrote:
>
> I'm playing around with slices.
> Found that slice of bytes with the size more than 10485760 is moved to the
> heap.
Because Go stacks are copied as needed, there is a tradeoff between
putting a value on the stack and putting it on the heap. O
I'm playing around with slices.
Found that slice of bytes with the size more than 10485760 is moved to the
heap.
package main
import (
"fmt"
"runtime/debug"
"time"
)
// run with escape analysis
// go run -gcflags '-m -l' main.go
func main() {
a()
fmt.Println("after a returned")
debug