7 ms·
That's changing. The standard library is almost entire GC-free now.
by CountHackulus 13y ago
That's changing. The standard library is almost entire GC-free now.
- he_the_great 13y agoThat's a little adventurous. std.algorithm is known to only have one function which allocates. The rest of Phobos is being looked at, but to this point I don't think it has been combed thoroughly enough to say "almost entire."
- jmdavisProg 13y agoYeah. The "almost entire" applies to std.algorithm. How much allocation goes on elsewhere depends on what module you're talking about. Some definitely avoid it, whereas others definitely require it. That will be (and has been) changing though. The main thing is probably going to be making much heavier use of output ranges rather than automatically allocating arrays/strings. We'll get there though, because there's clearly a lot of interest in doing so, and there's no fundamental reason why we can't.
- eco 13y agoI'm not sure where you got that idea but that's not true. The standard library make heavy usage of the GC. There is talk of implementing ARC to replace or supplement the GC and the standard library will most likely soon start using output ranges to avoid forced GC allocations in many cases but that hasn't happened yet.