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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,de1c23707584fc3c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-22 14:21:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: virtual destructors Date: 22 Apr 2003 21:19:42 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1051046490 2299 62.49.19.209 (22 Apr 2003 21:21:30 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 22 Apr 2003 21:21:30 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:36373 Date: 2003-04-22T21:19:42+01:00 List-Id: Stephen Leake writes: > Simon Wright writes: > > > Stephen Leake writes: > > > > > You also need to ensure that both access types use the same storage > > > pool. Something like: > > > > > > for CDerived'Storage_Pool use CBase'Storage_Pool. > > > > I don't see why? there was no attempt I could see to convert between > > the classwide pointer types? > > In general, the compiler can use different storage pools for each > access type. > > If you do: > > A : CBase := new Derived'(); > > and then later: > > Free (A); > > The compiler might allocation from CDerived_Storage_Pool, and then > deallocate from CBase_Storage_Pool. Very bad. Indeed, I hadn't spotted that particular problem (I was looking at the procedures, not the main program). Sorry.