3 ms·
> Enforcing not using anything that uses the garbage collector may be left to the programmer It's left to the compiler actually. Programmers can't be trusted.
by 4ad 10y ago
> Enforcing not using anything that uses the garbage collector may be left to the programmer
It's left to the compiler actually. Programmers can't be trusted.
The runtime does not implicitly generate garbage (like arbitrary Go code). It is compiled with a mode that fails compilation if something can't be stack-allocated. When heap allocation is necessary, it is requested manually. However, the memory returned is garbage collected, as usual, there is no free.