switch off GC?

Weed resume755 at mail.ru
Wed Feb 4 17:09:04 PST 2009


bearophile пишет:
> Weed, some built-ins and significant part of the standard lib (and other libs you can find around) assume the presence of a GC.

Right. For example, return from function of a dynamic array will not
work correctly without GC - there will be a memory leak.

> So you can disable (or often just not use it. If you don't allocate/free GC-managed memory then the GC sleeps) in some critical spots of your code as I do (and you can also just use memory from the C heap), but if you really want to remove it, you may want to consider using C++ instead.
> 
> I'd like too to have something like a -nogc compiler flag to not include the GC at all in small programs that don't use the GC (or use it only to allocate memory and not to free it).

My wishlist also contains -nogc (or may be -gc?) too. But it seems to me
it will not occur - too many parts of language mean presence GC.

I just would like that D could substitute C++ completely in all
applications...


More information about the Digitalmars-d-learn mailing list