4 ms·
Not doing anything, same as the other 3. Heap allocation is what requires requesting memory from an allocator.
by masklinn 2y ago
Not doing anything, same as the other 3.
Heap allocation is what requires requesting memory from an allocator.
- eikenberry 2y agoRight.. been using GC languages to long. Everything allocated to the stack unless it is specifically allocated to the heap. I was stuck thinking about what the keywords were. But I'm still curious.. are there any GC languages that have a way to specify if something should go on the stack or the heap?
- masklinn 2y ago> are there any GC languages that have a way to specify if something should go on the stack or the heap? I think only in the sense that some GCd language have value (stack) types as a separate hierarchy from heap types? E.g. structs in C# or Swift are stack-allocated (and value-identity, and copied) whereas classes are heap-allocated. Adding that for java is one of the goals of Project Valhalla I believe.
- stassats 2y agoCommon Lisp. The dynamic-extent declaration allows for stack allocation.