3 ms·
It is possible to allocate objects in the stack (objects without polymorphism, defined with the struct keyword). No use of heap and GC in that case at all. It'
by Shorel 12y ago
It is possible to allocate objects in the stack (objects without polymorphism, defined with the struct keyword). No use of heap and GC in that case at all.
It's not that different to using C++ objects in the stack.
If by no GC you mean to use heap allocated objects with manually managed destructors, then I think the answer is no.
- kvark 12y agoI'm looking at "http://dlang.org/garbage.html" http://dlang.org/garbage.html" section "D Operations That Involve the Garbage Collector", and there are some pretty interesting things on the list that require GC: all dynamic arrays, associative arrays, closures, asserts. Can you even read a file without these?
- steveklabnik 12y agoIn college, a group of is (mostly my friends) wrote a kernel in D, with no GC: http://xomb.org http://xomb.org It's true that D's stdlib still uses GC, but he D team has been working on eliminating that.