logoalt Hacker News

DanielHBtoday at 9:18 AM1 replyview on HN

isn't it the exact same as C in this regard? The pointer being on the stack or not depends how it was originally allocated.


Replies

nixon_why69today at 10:22 AM

In C you explicitly malloc things onto the heap. In go, taking the address of something maybe allocates on the heap, or maybe not if escape analysis can keep it on the stack.