[gclist] working with 64 bit ints/pointers

Charles Fiterman cef@geodesic.com
Fri, 12 Dec 1997 14:53:17 -0600

At 01:00 PM 12/11/97 +1300, you wrote:
>> Mike exagerates a bit here, bit just a bit. Theoretically
>> it is not precise, but practically speaking it is.
>There are three flaws in the argument:
>(a) things aren't uniformly distributed

Agreed but TNABTAF. Here is why. You don't have to get
memory via sbrk you can use things like VirtualAlloc and mMap.
These allow you to say "give me 8 pages and assign the following
virtual address." So you can avoid virtual addresses with bogus
pointers already aimed there, black listing. You can also avoid 
addresses that look like ascii strings or normalized floating 
point numbers. That cuts out huge ranges but still leaves even 
huger ones. Part of cooperation for some applications might
be suggesting address ranges to be avoided.
>(b) a pointer can be data too (consider especially programs such as
>debuggers/tracers where much data is pointers. Depending on the memory
>model in use, some pointers could be valid in both the client and the
>debuggers address space but point to separate copies of

In these cases you have to keep the objects, think about it. If the
debugger is keeping an address it clearly has a chance of looking
there and the collector can't free that address. What you've demonstrated
is that debuggers force the collector to keep things they might
free in the absence of the debugger. Why does this surprise you?
>(c) type-safe garbage collectors often make optimizations (i.e. no
>black-listing) that mean a single int/pointer confusion would have a
>more drastic effect than in a well designed conservative collector

Good argument for black listing. With huge address spaces you can
black list larger ranges e.g. black list 4M chunks not 4K pages.
If it becomes a problem you can ratchet to smaller chunks.

Charles Fiterman		Geodesic Systems
414 North Orleans Suite 410	Phone 312 832 1221 x223
Chicago IL 60610-4418		FAX   312 832 1230

            .-" +' "-.    __,  ,___,
           /.'.'A_'*`.\  (--|__| _,,_ ,_
          |:.*'/\-\. ':|   _|  |(_||_)|_)\/
          |:.'.||"|.'*:|  (        |  | _/
           \:~^~^~^~^:/          __,  ,___,
            /`-....-'\          (--|__| _ |' _| _,   ,
           /          \           _|  |(_)||(_|(_|\//_)
           `-.,____,.-'          (               _/