C++, D: Dinosaurs?

Nick Sabalausky a at a.a
Mon Nov 3 17:11:32 PST 2008


"Robert Fraser" <fraserofthenight at gmail.com> wrote in message 
news:geo5p6$12gk$1 at digitalmars.com...
> Tony wrote:
>> (one HAS to use GC with D, right?)
>
> No. Well, the compiler generates calls to allocate & free memory, but you 
> can replace those calls with whatever you want. See Tango's (druntime's) 
> "stub" GC, which just reroutes compiler-generated calls to GC methods to 
> malloc() and free(). You can implement your own "GC" or whatever 
> management scheme you want (in fact, if you're writing, say, a device 
> driver in D, you would want to use a custom allocator like this and not 
> the built-in GC).

Plus, D allows classes to have custom allocators and deallocators which can 
help when using either a non-GC approach or mix-and-match.

I would like to see a less hacky way to rip out the GC, but that's a rather 
low priority as current way is still perfectly workable. 





More information about the Digitalmars-d mailing list