6 ms·
Depends on the language. Go, for instance, gives you a lot of freedom when it comes to memory layout, and allows you stack allocate objects to avoid GC.
by Skinney 12y ago
Depends on the language. Go, for instance, gives you a lot of freedom when it comes to memory layout, and allows you stack allocate objects to avoid GC.
- coliveira 12y agoIf you're using the stack, by definition you're not using GC, so this cannot be an argument in favor of GC.
- Skinney 12y agoIm not arguing in favor of GC. The argument was that a GC takes away memory control, but memory control is up to the language. Go doesn't restrict you to stack/heap allocation. You can create structs which embeds other structs. This simplifies the job the GC has to do, even if you don't allocate on the stack. You can do something similar with Struct types in C#.