Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.object Subject: Re: C++ and garbage collection Message-ID: <57605@microsoft.UUCP> Date: 20 Sep 90 21:28:59 GMT References: <1990Sep12.074154.657@tukki.jyu.fi> <1990Sep16.090226.11051@tukki.jyu.fi> <57523@microsoft.UUCP> pcg@cs.aber.ac.uk (Piercarlo Grandi) writes: |Just to make things clearer, I think it has come the time for me to |summarize my understanding of the storage reclamation problem, so that |at least my own "hidden assumptions" on which I base my reasoning are |made explicit. .... |The efficiency of conservative garbage collection, measured as the |percentage of garbage that is not reclaimed, has been proven to be quite |high; this is because on many common os/architecture pairs only few |words that are not pointers into the heap look like they were, even |without taking a lot of care, so that little garbage is left |unreclaimed. | | Why? because on many machines the heaps are segments in fairly | high storage addresses, the typical heap address being often a | bit pattern like | | 0x0a00d1fc0 | | Most integers are not like this (almost all integers are < 100), | neither are most floats (this looks like being denormalized), | neither are most strings (strings are usually made up of | alphanumerical characters, and are often longer), etc... "Just to make things clearer" -- you're assuming you're running on machines with 32-bit integers, and 32-bit linear addresses. There's at least one large interesting class of machines on which these assumptions fail miserably.