Very unexpected!
My best guess is that with a deep recursion, you're forcing a stack growth of current goroutine, ending up with local variables in a new memory location.
val doesn't "escape" (to the heap), yet we can't rely on its address 
-
-
-
Yeah, that's my guess, too. There's a nice article online about the switch from the original segmented stacks to contiguous stacks, which require copying to new stacks for growth:https://blog.cloudflare.com/how-stacks-are-handled-in-go/amp/ …
- Još 5 drugih odgovora
Novi razgovor -
-
-
Dammmnp ( my brain sounds like Hommer Simpson after click for apparently "obvious" 2 distincts results.
@ChaveDeney We need u!!!! -
The nice thing is that if you save those pointers and compare them they are equal to each other

- Još 2 druga odgovora
Novi razgovor -
-
-
Replacing println with fmt.Println makes both print statements print the same address. I don't understand why?
-
Because interfaces are always treated as escaping to the heap, thus they are never moved
- Još 2 druga odgovora
Novi razgovor -
-
-
Try this one: package main func main() { var val int a := &val println(a) f(10000) b := &val println(b) println(a == b) // true? } func f(i int) { if i--; i == 0 { return } f(i) } https://play.golang.org/
#golang - Još 2 druga odgovora
Novi razgovor -
-
-
with some experimenting it only gets two diff pointers when i > 65 which i wasn't quite expecting
-
What did you expect?
- Još 2 druga odgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.
with parallel programming and security. (he/him)