News for hackers. Stuff that matters.
Re:GERT: Run Go on Bare Metal ARMv7 by Animats on Tuesday June 20, 2017 @12:28AM (#14592203)
There's a fair amount of implicit allocation in Go. When you reference a slice, you create a slice descriptor, which takes up space. Maps, channels, and goroutines all allocate. It's not impossible to avoid allocation in a block of code, but it's not just avoiding explicit allocation.

How do interrupts work in this system? Do they map to goroutines, or what?

Re:GERT: Run Go on Bare Metal ARMv7 by _ph_ on Tuesday June 20, 2017 @04:11PM (#14598139)
The thing is, this allocation is usually on the stack. With a bit of experience, it is relatively easy to write your program such that all these allocations are on the stack. The compiler also gives you a clear breakdown on which objects are allocated on the heap. It is one big advantage of Go vs. Java for example, that you do get much better control about the allocation. All Go types are "value types", so this creates much more control and less memory pressure. (Except for interfaces, they are great when you need dynamic typing, but they behave more like reference types and do some unavoidable heap allocation, so avoid them in code parts which must not allocate from the heap.)