On Friday, 12 October 2018 at 16:26:49 UTC, Stanislav Blinov wrote:
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.

What a bunch of nonsense! I used to talk like this some 20 years ago when all I saw in the computing world was C and C++...

Sure garbage collection is not for every project, depends what industry you are in I guess... In my case (business applications/services) I have never had the need to turn off garbage collection!

However, someone in the gaming industry, embedded or realtime systems would indeed need to turn off the GC...

Reply via email to