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,9d56a9e1aac251b6 X-Google-Attributes: gid103376,public From: Laurent Guerby Subject: Re: Access to classwide type Date: 2000/07/25 Message-ID: <864s5eb7s7.fsf@acm.org>#1/1 X-Deja-AN: 650556142 References: <8lfuof$ipb$1@nnrp1.deja.com> <8li0m5$1i4$1@nnrp1.deja.com> <8li2f1$8q61@news.cis.okstate.edu> X-Trace: front6m.grolier.fr 964535490 27908 194.158.109.119 (25 Jul 2000 14:31:30 GMT) Organization: Club-Internet (France) NNTP-Posting-Date: 25 Jul 2000 14:31:30 GMT Newsgroups: comp.lang.ada Date: 2000-07-25T14:31:30+00:00 List-Id: dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner) writes: > [...] I believe GNAT just implements it as a small wrapper around > C's free function. For the default allocation pool in GNAT yes (gnat_free). In general at the language level, if you write your own pools, the deallocation function (see System.Storage_Pools) has size and alignment parameters, and the compiler has always a way to fill them with the corresponding allocated parameters as required by 13.11.2 (9). So you know a bit more than C free. I believe that for all tagged types, GNAT generates a few hidden primitive subprograms to handle this in the class-wide case (see -gnatdg expansion of 'size attributes on such beasts to make your mind ;-). I don't know for other compiler technology. For arrays and discriminated types, the compiler can obviously generate small pieces of code to compute the size of things, since the information must be around in some ways to do all the Ada required checking. -- Laurent Guerby