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,FREEMAIL_FROM,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a46843ba8cee64d2,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-19 07:07:05 PST From: "Anisimkov" Newsgroups: comp.lang.ada Subject: dinamic object reclamation Date: Wed, 19 Sep 2001 20:27:08 +0600 Organization: A poorly-installed InterNetNews site Distribution: world Message-ID: <9oa69d$6ej$1@ns.omskelecom.ru> NNTP-Posting-Host: 195.162.36.156 X-Trace: ns.omskelecom.ru 1000905838 6611 195.162.36.156 (19 Sep 2001 13:23:58 GMT) X-Complaints-To: usenet@ns.omskelecom.ru NNTP-Posting-Date: Wed, 19 Sep 2001 13:23:58 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!news2.aha.ru!news.rosprint.net!radius!not-for-mail Xref: archiver1.google.com comp.lang.ada:13176 Date: 2001-09-19T20:27:08+06:00 List-Id: I wrote the test program about it. ----------------------------- with text_io; use text_io; procedure alloc is dummy : character; procedure act (i : integer) is type block is array (1 .. 1024) of integer; type block_ptr is access all block; ptr : block_ptr; begin ptr := new block; ptr (ptr'LAst) := i; put (integer'image(I)); end; begin for i in 1..20000 loop act (i); get_immediate(dummy); end loop; end; -------------------- The question is: Is memory allocated by ptr := new block; have to be freed automatically after leaving of procedure act ? Am I have to use Ada.Unchecked_Deallocation for free memory ? I'm acking becouse there is a memory leak without Unchecked_Deallocation when program compiled in the GNAT 3.13. Is it bug or regular behavior ?