You don't like GC? Do you?

Stanislav Blinov stanislav.blinov at gmail.com
Fri Oct 12 16:26:49 UTC 2018


On Thursday, 11 October 2018 at 21:22:19 UTC, aberba wrote:
> "It takes care of itself
> -------------------------------
> When writing a throwaway script...

...there's absolutely no need for a GC. In fact, the GC runtime 
will only detract from performance.

> What this means is that whenever I have disregarded a block of 
> information, say removed an index from an array, then that 
> memory is automatically cleared and freed back up on the next 
> sweep. While the process of collection and actually checking

Which is just as easily achieved with just one additional line of 
code: free the memory.

> Don't be a computer. Do more with GC.

Writing a throwaway script there's nothing stopping you from 
using mmap or VirtualAlloc. The "power" of GC is in the language 
support for non-trivial types, such as strings and associative 
arrays. Plain old arrays don't benefit from it in the slightest.



More information about the Digitalmars-d mailing list