home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!microsoft!hexnut!jimad
- From: jimad@microsoft.com (Jim Adcock)
- Subject: Re: Garbage Collection for C++
- Message-ID: <1992Aug20.213720.16599@microsoft.com>
- Date: 20 Aug 92 21:37:20 GMT
- Organization: Microsoft Corporation
- References: <TMB.92Aug16164940@arolla.idiap.ch> <1992Aug18.021453.24394@news.mentorg.com> <DAVEG.92Aug17224359@synaptx.synaptics.com>
- Lines: 25
-
- In article <DAVEG.92Aug17224359@synaptx.synaptics.com> daveg@synaptics.com (Dave Gillespie) writes:
- |In article <1992Aug18.021453.24394@news.mentorg.com> bcannard@hppcb36.mentorg.com (Bob Cannard @ PCB x5565) writes:
- |>|> Now, it turns out that in some cases, GC is actually "guaranteed" to
- |>|> be faster, in the sense that it can combine very low-cost allocation
- |>|> with no overhead deallocation (that is, 0 machine cycles per word).
- |
- |Well, now, this sounds like the same logic people use to ruin themselves
- |with credit cards... Remember, you still wind up paying (for deallocation),
- |just later instead of right away. But the convenience of paying later,
- |and the efficiency of paying in chunks, is a big win.
-
- In generation schemes, both long-lived and short-lived objects have
- allocation and deallocations costs that are very very small -- IE "0"
- There are significant allocation and deallocation costs only for object
- that fall in between these two extremes -- objects that live to be middle
- aged. And the cost of these objects is not really the cost of allocating
- or deallocating them, but rather the cost of keeping them young.
-
- Indirectly, one could argue its the deaths of the short-lived objects that
- define the lifetime of a generation, and thus indirectly the short-lived
- objects share a portion of the blame for the costs of the medium-lived
- objects. Still, "0" allocation and deallocation costs for the "typical"
- object is a fair description of the behavior one sees in practice --
- its only the "atypical" objects that cost you anything significant.
-
-