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-Thread: 103376,d067a5a7c60c3b40 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!out02a.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!nx01.iad01.newshosting.com!newshosting.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Unchecked_Deallocation vs. delete Date: Wed, 09 May 2007 16:54:42 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1178728045.890171.6110@q75g2000hsh.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1178744083 32421 192.74.137.71 (9 May 2007 20:54:43 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 9 May 2007 20:54:43 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:gYz6DwKLNaY7o7KX5Q4/VGELySg= Xref: g2news1.google.com comp.lang.ada:15690 Date: 2007-05-09T16:54:42-04:00 List-Id: Maciej Sobczak writes: > What's the benefit of Unchecked_Deallocation as a generic library > procedure vs. built-in deallocation operator like delete in C++? > > The disadvantage, as far as I perceive it, is that it breaks the > symmetry that should be expected with regard to the allocation > operation. If "new" is built-in, then the deallocation should be built- > in as well. Making it a generic library procedure just makes more work > for the programmers for no clear reason. > > What clear reason am I missing? I think you're right. Not missing anything. The original reason why U_D is a generic procedure is probably because the designers of Ada 83 imagined that garbage collection would be ubiquitous, so U_D would rarely be necesary. I suppose they thought that "with U_D;" would be a red flag, at the top of the package that does such "evil" things. Note that U_D is banished to chapter 13, where all the other machine-dependent stuff lives. - Bob