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,aa968038a51ee866 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Q: Ada.Unchecked_Deallocation Date: 1996/07/20 Message-ID: #1/1 X-Deja-AN: 169275333 references: <31E5D4D1.11DB36E1@jinx.sckans.edu> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-07-20T00:00:00+00:00 List-Id: Laurent said: What about (in Ada 95 without extension): type KLUNK_WITH_EMPTY_FINALIZE is new KLUNK with null record; procedure Finalize (Obj : KLUNK) is begin null; end Finalize; And instead of applying the pragma, you declare objects of this new type. A smart compiler can optimize away calls to such a Finalize subprogram. Robert replies It would have to be VERY SMART! The body of Finalize appears in the package body and the client typically only sees the package spec. And also, this may require introducing conversions all over your program which you would prefer to avoid.