Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!princeton!udel!rochester!bbn!husc6!linus!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: pointer alignment when int != char * Message-ID: <898@mcgill-vision.UUCP> Date: Tue, 22-Sep-87 01:36:10 EDT Article-I.D.: mcgill-v.898 Posted: Tue Sep 22 01:36:10 1987 Date-Received: Sat, 3-Oct-87 06:10:18 EDT References: <493@its63b.ed.ac.uk> <6061@brl-smoke.ARPA> <3812@spool.WISC.EDU> <8024@think.UUCP> Organization: McGill University, Montreal Lines: 29 Xref: utgpu comp.lang.c:4433 comp.unix.wizards:4289 In article <8024@think.UUCP>, barmar@think.COM (Barry Margolin) writes: > In article <588@murphy.UUCP> dave@murphy.UUCP (Dave Cornutt) writes: [>>> is someone else; Dave is >>] >>> [Lisp Machines have a garbage collector which moves objects, >>> resulting in pointers that change behind your back] >> [but this means a pointer can be invalidated on you] > [when GC moves something, it updates all pointers.] > A particular pointer variable will always point to the same object > (until it is reassigned, of course), although its internal numerical > value may change. > I'm not sure how they deal with the fact that a pointer cast into an > integer and back into a pointer (or is it vice versa?) must maintain > its value. My guess is that they maintain a hash table of pointers > that have been converted into integers. Lisp doesn't have that sort of cast (well, it usually does, but only as a documented-to-be-dangerous subprimitive). Does Symbolics or LMI or anyone provide a C compiler for a Lisp Machine? If they do, I would guess that either they do as you suggest, maintaining some table of objects which must not be moved, or they have hooks into the garbage collector permitting the C run-time to lock objects down, or they simply make the whole C environment one lisp object, which must be relocated as a whole if it is relocated at all. (Then of course all pointers will be relative to the beginning of this area.) der Mouse (mouse@mcgill-vision.uucp)