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: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen) Subject: Re: Access to classwide type Date: 2000/07/24 Message-ID: #1/1 X-Deja-AN: 650357411 References: <8lfuof$ipb$1@nnrp1.deja.com> <8li0m5$1i4$1@nnrp1.deja.com> <8GRaL$AJ9PHa@eisner.decus.org> <8lij0o$fqa$1@nnrp1.deja.com> X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 964486351 216.44.122.34 (Tue, 25 Jul 2000 00:52:31 GMT) Organization: LJK Software NNTP-Posting-Date: Tue, 25 Jul 2000 00:52:31 GMT Newsgroups: comp.lang.ada Date: 2000-07-24T00:00:00+00:00 List-Id: In article <8lij0o$fqa$1@nnrp1.deja.com>, reason67@my-deja.com writes: > In article <8GRaL$AJ9PHa@eisner.decus.org>, > >> In article <8li0m5$1i4$1@nnrp1.deja.com>, reason67@my-deja.com writes: >> > How in the heck does it do that? Does Ada.Unchecked_Deallocation > read >> > the tag and do a `size on the data structure to determine the size > of >> > the memory in heap to release? I am suprised by this. It is more >> > implicit than I am used to in Ada. > >> If it works for access to a variant type, why shouldn't it work here ? >> > > Big difference there. A variant record is defined at compile time. The But which variant is addressed by a particular access variable cannot be known at compile time. > number of children on a tagged type can not be known until link time. > The machine code for the unchecked deallocation has to be static at > compile time. Like I said, I am betting it reads the 'size inside the > unchecked deallocation at run-time and deleting the size it determines. That sounds reasonable, but not particularly different from the variant case.