News for hackers. Stuff that matters.
Re:My thoughts on Google Go by matthw on Thursday November 12, 2009 @07:16AM (#937598)
Ah, of course.

Although, gotta wonder how these stack-allocated objects interact with closures.

Re:My thoughts on Google Go by dkersten on Thursday November 12, 2009 @07:55AM (#937645)
Other languages that support closures have stack allocated objects too. So its no different in this case.

Maybe this wikipedia article has details: http://en.wikipedia.org/wiki/Thunk

Re:My thoughts on Google Go by barrkel on Thursday November 12, 2009 @09:24AM (#937790)
C-style stack allocated objects captured by closures are not memory-safe in the absence of escape analysis. If the closure outlives the stack frame that allocated the object, a dangling pointer may occur, unless the stack frame itself is allocated on the heap, or the captured objects are moved by the compiler into a structure which is itself allocated on the heap.
Re:My thoughts on Google Go by dkersten on Thursday November 12, 2009 @10:25AM (#937875)
Exactly, the stack frame needs to survive with the Closure.