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,21960280f1d61e84 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: comp.lang.ada Subject: Re: GC in Ada References: <1169636785.504223.139630@j27g2000cwj.googlegroups.com> <45b8361a_5@news.bluewin.ch> <3pejpgfbki.fsf@hod.lan.m-e-leypold.de> <45c99c24$1@news.post.ch> From: Markus E Leypold Organization: N/A Date: Wed, 07 Feb 2007 12:08:09 +0100 Message-ID: <7qy7na2pk6.fsf@hod.lan.m-e-leypold.de> User-Agent: Some cool user agent (SCUG) Cancel-Lock: sha1:E6dIX85pb4HL/9npny+Iof4Cruo= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 88.72.241.241 X-Trace: news.arcor-ip.de 1170846182 88.72.241.241 (7 Feb 2007 12:03:02 +0200) X-Complaints-To: abuse@arcor-ip.de Path: g2news2.google.com!news4.google.com!news2.google.com!news3.google.com!newshub.sdsu.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-ip.de!news.arcor-ip.de!not-for-mail Xref: g2news2.google.com comp.lang.ada:9109 Date: 2007-02-07T12:08:09+01:00 List-Id: Martin Krischik writes: > Maciej Sobczak schrieb: > >> Yes. Note that scoped lifetime does not preclude GC on some lower level. >> Scoped lifetime provides a hook for deterministic "good bye" action >> - >> there is nothing more to it. Even if that "good bye" action calls >> free/delete/whatever on some memory block, there is nothing that >> forces the runtime to return the given block of memory right back to >> the operating system. Actually, none of the self-respecting >> allocators do this systematically - instead they keep the memory >> around for a while in anticipation of future allocations. > > I believe in most systems memory is never returned. > > If I understood Unix file management right only memory at the end of > the heap can be returned. Without compaction a no go. You're partly right. It depends on the heap implementation. If done using sbrk() you're right. If done using mmap() you'd have -- theoretically -- the possibility wo return sufficiently large holes to the OS. Regards -- Markus