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!out03b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!nx01.iad01.newshosting.com!newshosting.com!post01.iad01!roadrunner.com!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Unchecked_Deallocation vs. delete References: <1178728045.890171.6110@q75g2000hsh.googlegroups.com> <1hzydt9ej6az6$.12jl0su9budun.dlg@40tude.net> From: Keith Thompson Organization: None to speak of Date: Wed, 09 May 2007 13:59:55 -0700 Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:pCPTdvj1zHanxRXFscBmYhdq54s= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@rr.com Xref: g2news1.google.com comp.lang.ada:15693 Date: 2007-05-09T13:59:55-07:00 List-Id: "Dmitry A. Kazakov" writes: > On 9 May 2007 09:27:25 -0700, Maciej Sobczak wrote: >> What's the benefit of Unchecked_Deallocation as a generic library >> procedure vs. built-in deallocation operator like delete in C++? > > To make it harder to use. [...] Yes. Allocation is safe; it either succeeds or fails cleanly. Deallocation, if you happen to deallocate the wrong thing, can fail in arbitrarily bad ways. Requiring you to instantiate Unchecked_Deallocation (emphasis on "Unchecked") is intended as a reminder that it's entirely up to *you* to get it right; if you mess up the argument, the implementation isn't going to save you. -- Keith Thompson (The_Other_Keith) kst-u@mib.org San Diego Supercomputer Center <*> "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"