4 ms·
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.
by DanielHB 3mo ago
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.
- nixon_why69 3mo agoIn 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.