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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a46843ba8cee64d2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-19 10:07:04 PST From: "Anisimkov" Newsgroups: comp.lang.ada Subject: Re: dinamic object reclamation Date: Wed, 19 Sep 2001 23:44:08 +0600 Organization: A poorly-installed InterNetNews site Distribution: world Message-ID: <9oahqo$3on$1@ns.omskelecom.ru> References: <9oa69d$6ej$1@ns.omskelecom.ru> NNTP-Posting-Host: 195.162.36.132 X-Trace: ns.omskelecom.ru 1000917658 3863 195.162.36.132 (19 Sep 2001 16:40:58 GMT) X-Complaints-To: usenet@ns.omskelecom.ru NNTP-Posting-Date: Wed, 19 Sep 2001 16:40: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:13181 Date: 2001-09-19T23:44:08+06:00 List-Id: > > 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; > size for Block_Ptr's storage pool. For example, in the above code, add the line: > > for Block_Ptr'Storage_Size use 4098; > > and you should be OK (If you get Storage_Error, jack up the number a bit). You > won't be able to allocate any more than the specified number of bytes this way, > but a conforming compiler *will* reclaim the storage when the access type goes > out of scope. (LRM 13.11-18). Yes it is. Thank you Ted. But there is more then limit of memory usage becouse I wrote for Block_Ptr'Storage_Size use Integer'Last; inside of procedure "act". and memory is not leaking now. It looks like a trick.