News for hackers. Stuff that matters.
Re:A New Go API for JSON by throwaway894345 on Wednesday November 04, 2026 @11:20PM (#50375136)
If you pass a pointer into a function, the Go compiler can (and sometimes does) allocate it on the heap. Go has no allocation/ownership semantics, tragically, so the best we can do is depend on undefined behavior regarding the escape analyzer and hope the Go team doesn’t break it (which is a relatively safe assumption, considering that it’s unlikely that the Go team would start allocating things on the heap that were previously allocated on the stack—Go rarely regresses performance like this).

There are no comments on this comment yet.