Re:Mac Apps That Use Garbage Collection Must Move to ARC
by Skinney on Sunday February 22, 2015 @05:48AM
(#9089003)
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.
Re:Mac Apps That Use Garbage Collection Must Move to ARC
by coliveira on Sunday February 22, 2015 @10:04PM
(#9092326)
If you're using the stack, by definition you're not using GC, so this cannot be an argument in favor of GC.
Re:Mac Apps That Use Garbage Collection Must Move to ARC
by Skinney on Tuesday February 24, 2015 @04:34PM
(#9103686)
Im 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#.
This only happens if you choose to organize the data this way. This is a big difference from GC, where the whole memory layout and GC algorithm is out of your control.