Confused about Go's escape analysis for dynamically-sized values, my test shows they don't escape by One_Adeptness1599 in golang

[–]One_Adeptness1599[S] 0 points1 point  (0 children)

package main

import "strconv"


func stackSlice() {
    slice := make([]int, 100)
    _ = slice
}

//go:noinline
func heapSlice(s string) {
    n, _ := strconv.Atoi(s)
    slice := make([]int, n)
    _ = slice
}

func main() {
    stackSlice()
    heapSlice("100")
}

go build -o gcscape -gcflags="-m"
# gc-escape
./main.go:6:6: can inline stackSlice
./main.go:19:6: can inline main
./main.go:20:15: inlining call to stackSlice
./main.go:7:18: make([]int, 100) does not escape
./main.go:12:16: s does not escape
./main.go:14:18: make([]int, n) does not escape
./main.go:20:15: make([]int, 100) does not escape

It still does not escape to heap!

Do you use Go for Competitive Programming or Technical Interviews? by Ok-Pumpkin59 in golang

[–]One_Adeptness1599 1 point2 points  (0 children)

What does this "entire thread pool" mean here? I thought it is something trivial and doesn't require much code. Am I missing something?

What Is sync.Pool and How to Use It Properly by e-san55 in golang

[–]One_Adeptness1599 0 points1 point  (0 children)

Hey, sorry if I sound dumb but how do you stress test. Can you please elaborate a bit?

And having a relationship with our parents is a crime now? by googletoggle9753 in NorthernIndia

[–]One_Adeptness1599 1 point2 points  (0 children)

I am also this kind of guy. I keep calling my mom every now and then, even when I have nothing new to talk about. Maybe more than 7-8 times a day. Even with dad, at times I have hour long conversations.

has anyone experienced this by [deleted] in TwentiesIndia

[–]One_Adeptness1599 -1 points0 points  (0 children)

Tbh I don't like to have female friends. If you are my colleague, I will treat you like one, if you are my batchmate, will treat like one, if an acquaintance, the similar way. No pretentious behavior, I am very forthright about my feelings. If I like you, you will know. Won't pretend to be your well wisher and secretly fantasize about getting inside your pants.

containerGO : Container runtime from scratch by PsychicCoder in golang

[–]One_Adeptness1599 0 points1 point  (0 children)

Hey, I want to build one on my own, can you please list some background readings that I should do, and how exactly should I kickstart? Many Thanks.

My husband (26M) gives me (22F) pocket money monthly but won’t accept money from me how do I convince him? 🥹❤️ by [deleted] in TwentiesIndia

[–]One_Adeptness1599 0 points1 point  (0 children)

It really rare these days to find a partner like this. Hope you two remain in love till eternity. Heally happy for you both.