Re: C++ and garbage collection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Florian Weimer <fw@xxxxxxxxxxxxx> wrote:

Hi,

> > My idea is to add some mark+sweep gc (boem-gc ?) and remove (or
> > somehow disable) all delete operations. Does that work safely,
> > or do I have to cope with certain nasty side effects ?
> 
> Performance might change.

Okay, it might block a little time when the GC runs, but as it's
a menu-driven application, this won't matter much, IMHO.

> Object lifetimes are no longer deterministic, and destructors will not
> be called.  This can be a significant issue.

Yes, for examples having to close fd's before unmounting filesystems.
But these places are quite few, already identified and mostly
encapsulated, so I can easily add an direct close (independent of
object lifetimes) instead of the delete operations.

> There are a few cases when the Boehm-Dehmers-Weiser collector won't
> work, for instance if you have got custom memory allocators or use
> some pointer encoding schemes.

That's not the case in my app. Purely C++, plus some additional
libraries which I could review quite easily.


cu
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@xxxxxxxx
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux