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: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Garbage Collection in Ada Date: 1996/10/17 Message-ID: #1/1 X-Deja-AN: 190114665 references: <01bbb910$f1e73f60$829d6482@joy.ericsson.se> <1996Oct16.080524.1@corning.com> organization: New York University newsgroups: comp.lang.ada Date: 1996-10-17T00:00:00+00:00 List-Id: Robert Eachus says " Just out of curiousity, how do you implement access to subprogram types in GNAT? Do you use a pair of addresses or stick the code pointer in the stack frame? Or does this vary from target to target? " We follow the GCC model of trampolines (remember that GNU-C already has nested procedures, using a static chain). The trampoline is a small bit of code in the stack frame that loads the right static link and jumps to the right place. This is done in GNU-C because of a feeling that C programmers expect all pointers to be the same size. In fact it is a poor choice for Ada, whre a fat pointer would be better, since there is no similar expectation. The trouble with trampolines is that on some systems it rquires a system call to flush the cache on a Harvard architecture processor, and this can mean that the elaboration of nested procedures is expensive.