Allocating Executable Memory

David Nadlinger see at klickverbot.at
Tue Jul 31 12:37:46 PDT 2012


On Tuesday, 31 July 2012 at 18:06:28 UTC, Maxime Chevalier wrote:
> How well does the D GC deal with immovable objects. Would it be 
> a problem if I allocated many chunks of immovable data?

D's GC currently doesn't move memory at all, so this should not 
be a problem. If there is a chance that all references to the 
object in question in D-managed memory (i.e. stack, GC heap) go 
away, but the memory is still used, you might need to manually 
mark the object as live, though (see core.memory.GC.addRoot).

> Also, if you don't mind me asking, which D compiler do you guys 
> prefer? Which one is most widely supported, most up to date?

DMD is the official reference compiler and compiles faster than 
the others, but is x86-only (32 bit only on Windows), and the 
performance of the generated code is sometimes significantly 
worse than with the other compilers. GDC and LDC also use the 
same frontend as DMD, but it usually takes them a few weeks to 
catch up after a new version of it is released. LDC currently 
doesn't work on Windows if your application uses exception 
handling (which most applications do).

I personally use LDC as my default compiler, but I might be 
biased… ;)

David


More information about the Digitalmars-d mailing list