C++, D: Dinosaurs?

Robert Fraser fraserofthenight at gmail.com
Tue Nov 4 13:21:15 PST 2008


Nick Sabalausky wrote:
> IIRC, you just go into "extern (C) int main(size_t argc, char **argv)" in 
> the internal portion of phobos/tango/druntime or wherever it lives now and 
> comment-out the calls to "gc_init()" and "gc_term()". You might also need to 
> call "gc.disable()" or something (don't really remember). And then if you 
> still want to use "new" and/or "delete" with your own memory manager, you 
> can use D's class allocator and deallocator feature 
> (http://www.digitalmars.com/d/1.0/class.html#allocators). I assume you could 
> probably plug those class allocators/deallocators directly into the internal 
> object class if you wanted. 

That would work in all cases and be the only way if using D1+Phobos, but 
for Tango or D2/druntime, the better way would be 
http://www.dsource.org/projects/tango/browser/trunk/lib/gc/stub . The 
way you described would still link in the old GC and possibly generate 
erroneous calls to it.



More information about the Digitalmars-d mailing list