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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8749545ac52d7b9c X-Google-Attributes: gid103376,public From: ncohen@watson.ibm.com (Norman H. Cohen) Subject: Re: Great Circle and Ada? Date: 1996/09/17 Message-ID: <51mj21$jif@watnews1.watson.ibm.com>#1/1 X-Deja-AN: 181162804 distribution: world references: organization: IBM T.J. Watson Research Center reply-to: ncohen@watson.ibm.com newsgroups: comp.lang.ada Date: 1996-09-17T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) writes: |> In article , |> Lars Farm wrote: |> >What is virtual origin? ... |> >... Is is a pointer into the interior of |> >an allocated block rather than to the start of the block? If so, at least |> >Boehms GC has no problems with it and Great Circle can probably handle |> >interior pointers too. |> |> It's quite possible to implement GC with virtual origins, but the GC has |> to know about it, and do the appropriate thing (just like the |> compiler-generated code does). This requires some cooperation between |> the compiler and the GC (which is a Good Thing anyway, IMHO, but is not |> the case with gcc/GNAT). However, a CONSERVATIVE garbage collector makes guesses about which words are pointers precisely because it has no information about how the compiler has laid out storage. The only knowledge exploited by a conservative garbage collector is knowledge of the data structure (typically boundary tags) used by the run-time system's allocator. If a word contains a value that happens to lie between the addresses of the beginning and ending boundary tags for an allocated block, the conservative collector marks that block as reachable, and goes on to examine the words in that block in the same manner. (For typical versions of malloc, it is possible to find all boundary tags by recognizing the first word on the heap as a beginning tag, using the length information to find the corresponding closing tag, recognizing the next word as the beginning tag of the next block, and so forth.) If a compiler uses virtual origins, then a block may be, in effect, pointed to by a word whose value does not lie between the addresses of the beginning and ending boundary tags. -- Norman H. Cohen ncohen@watson.ibm.com