From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3498dd887729ed19 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Garbage Collection in Ada Date: 1996/10/20 Message-ID: #1/1 X-Deja-AN: 190792835 references: <01bbb910$f1e73f60$829d6482@joy.ericsson.se> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-10-20T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >...As has been >pointed out, this is not strictly correct code, but in the absence >of a conservative garbage collector running around and deleting >unrefrenced blocks (:-) will in fact work on any imaginable C >compiler, ... Not *quite* true -- there *are* C compilers that try to detect non-ANSI-compliant use of pointers (for debugging purposes only, since it's extremely inefficient), and you presumably would not be able to run GIGI on such a compiler. Of course GIGI is a special case -- when one is committed to doing a bootstrapped compiler, one has a lot of freedom to play games. For example, I'm sure the GNAT front end would not compile on any Ada compiler other than GNAT. In fact, in some cases, one version of the GNAT compiler won't compile under a different (earlier or later) version of GNAT. >The second answer is that in optimizing code, all sorts of transformations >can occur, especially if you start doing high level optimization that >can cause non-zero based arrays to appear as part of the transformations. >This is the situation in which a compiler may end up fiddling with pointers >in a way that is incompatible with a conservative GC. Oh, OK. I didn't think that's exactly what "virtual origins" meant -- I would call that "using algebraic transformations to represent pointers", or "virtual-origin-like optimizations". I guess it amounts to the same thing. >The use of a conservative GC system is, like the virtual origin coding >in Gigi, something that probably works OK, even though it is requires >some dubious fiddling (in particular the assumption that type casts >from integer to pointer leave bits unchanged, something that the ANSI >C specification could not require even if it wanted to). They could have required that type casts of that nature don't lose information, so they're reversible. If they had wanted to, which they didn't. - Bob