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,5c51cff2651b47f4 X-Google-Attributes: gid103376,public From: "Pat Rogers" Subject: Re: access type question (maybe a little silly) Date: 2000/10/19 Message-ID: #1/1 X-Deja-AN: 683623450 References: X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 X-Complaints-To: abuse@swbell.net X-Trace: nnrp1.sbc.net 972004177 208.191.184.67 (Thu, 19 Oct 2000 20:09:37 CDT) Organization: SBC Internet Services X-MSMail-Priority: Normal NNTP-Posting-Date: Thu, 19 Oct 2000 20:09:37 CDT Newsgroups: comp.lang.ada Date: 2000-10-19T00:00:00+00:00 List-Id: "Carles" wrote in message news:ezLH5.6327$Uk1.151137@telenews.teleline.es... > Do access type objects need to be destructed when they are not longer used? That depends upon what you really mean by "access type objects". If you mean that literally, the answer is "probably not", since they are likely declared on the stack. (Yes one can have access values that designate other access values, but that is somewhat unusual and will be covered by the second part of the answer.) In the following, type T is access all Integer; P : T; the object P is of type T (I'm being somewhat loose with the terminology; it won't hurt). Object P could reasonably be called an "access type object". If what you really mean is "do the values *designated* by access type objects need to be destroyed when no longer used" then the answer depends. After this statement, P := new Integer; P.all is the (Integer) object designated by P, which comes out of some pool (sort of a heap). Does that integer need to be deallocated? Depends upon what you're doing. There is, however, likely no garbage collector unless you're targeting to the JVM. (I know of no Ada compilers that provide GC apart from those that target the JVM, due to lack of demand.) If you're running an application that executes for a very long time, then you might want to do the reclamation. If you're running a desktop, one-off, short-lived application, then it probably won't be worth the effort. The bottom line is that it depends upon the nature of the application domain, the behavior of the program, and the environment in which it runs. --- Patrick Rogers Consulting and Training in: http://www.classwide.com Deadline Schedulability Analysis progers@classwide.com Software Fault Tolerance (281)648-3165 Real-Time/OO Languages Adam ... does not deserve all the credit; much is due to Eve, the first woman, and Satan, the first consultant. Mark Twain