Category talk:Go: Difference between revisions

Arena storage pool done.
(various updates)
(Arena storage pool done.)
Line 27:
===Add a variable to a class instance at runtime===
Go has no dynamic type defintion. All data types are determined and fixed at compile time.
 
===Arena storage pool===
Go uses a single arena, created at program load and managed by the Go runtime. Mmap is available as a syscall, but Go offers no support for initializing a raw block of memory like this as a usable heap and no support for working with multiple managed heaps. Its multiple stacks, I believe, are created within this one arena.
 
===Calendar - for "real" programmers===
Line 77 ⟶ 74:
 
==Once omitted, now solved!==
===Arena storage pool===
Go uses a single arena, created at program load and managed by the Go runtime. Mmap is available as a syscall, but Go offers no support for initializing a raw block of memory like this as a usable heap and no support for working with multiple managed heaps. Its multiple stacks, I believe, are created within this one arena.
 
Update: Solution posted using sync.Pool. It's no mmap solution, but I think it satisfies the general wording of the task. An mmap solution, probably with cgo, might still be interesting some day.
 
===Exceptions/Catch an exception thrown in a nested call===
The specific wording of the task description excludes Go. It specifies that foo call bar, bar call baz, and foo catch U0. The only execption-like mechanism we have is panic/recover. If foo defers a function that uses recover, it can catch a panic, but it ''cannot continue executing.'' Deferred means deferred to the end and foo is ending one way or another the first time a panic gets to it.
1,707

edits