home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!decwrl!parc!boehm
- From: boehm@parc.xerox.com (Hans Boehm)
- Subject: Re: Garbage Collection for C++
- Message-ID: <boehm.714327964@siria>
- Sender: news@parc.xerox.com
- Organization: Xerox PARC
- References: <1992Aug6.014619.2111@ucc.su.OZ.AU> <DAVEG.92Aug17231725@synaptx.synaptics.com> <1992Aug19.180252.12942@mole-end.matawan.nj.us> <DAVEG.92Aug20043156@synaptx.synaptics.com> <TMB.92Aug20143223@arolla.idiap.ch>
- Date: 20 Aug 92 16:26:04 GMT
- Lines: 32
-
- tmb@arolla.idiap.ch (Thomas M. Breuel) writes:
- >I think the answer is simpler than that. Delete should continue to
- >work as it does (including returning memory to the system).
-
- >In addition to that, there may be facilities to allow the programmer
- >to specify finalization of heap objects that are about to be collected
- >but have not been "deleted". Such a facility would not require any
- >language changes; something like "gc_set_finalization_hook(void*,void
- >(*f)(void*))" might do the trick. Some people may prefer to use such a
- >facility simply to detect memory leaks in existing programs, while
- >others might want to use it, for example, to release external
- >resources.
-
- Technical point:
- There are some important issues related to the order in which
- objects get finalized by the collector. If your program drops both an
- IO buffer and a corresponding file descriptor, the IO buffer needs to
- get finalized first, so that its contents can still be flushed.
- Typically finalization proceeds in topological order. This means cycles
- become a problem. The new version of our stand-alone collector in
-
- parcftp.xerox.com:~ftp/pub/russell/gc.tar.Z
-
- has one proposed (and still controversial) way of handling this.
-
- (The current version of this collector has some known bugs, which you
- you may or may not notice. It will be replaced by version 2.2 shortly.
- The finalization interface is not expected to change.)
-
- Hans-J. Boehm
- (boehm@parc.xerox.com)
-
-