Garbage Collector

Konstantin via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 15 09:52:33 PDT 2016


On Wednesday, 15 June 2016 at 13:40:11 UTC, rikki cattermole 
wrote:

> 5. The requirements for our GC is quite intricate. I.e. you 
> can't just
> pop in one that doesn't understand about our Thread Local 
> Storage (TLS)
> and stuff.
D’s TLS that different from .NET's TLS? 
https://msdn.microsoft.com/en-us/library/system.threadstaticattribute(v=vs.110).aspx

> I forgot to mention, good D code is not the same as a higher 
> level language like Java.
> Here you don't have the automagick behavior of arrays. If you 
> append it will have a high cost. All allocations have a large 
> cost. Instead allocate in one large block which will of course 
> be a whole lot faster then small tiny ones.
You’re saying memory allocations in D are generally very 
expensive, but that’s not a problem, because it already functions 
as designed?

> So even if the GC is enabled, good D code won't cause too much 
> slow down unless you decide to write heavy OOP code.
I’ve been developing heavy OOP code in various languages (mostly 
C++, but also C# and Objective-C) for decades already. OOP works 
very well for me.


More information about the Digitalmars-d mailing list