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 Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!164.128.36.58!news.ip-plus.net!newsfeed.ip-plus.net!news.post.ch!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: GC in Ada Date: Wed, 07 Feb 2007 10:30:11 +0100 Organization: Swisscom IP+ (post doesn't reflect views of Swisscom) Message-ID: <45c99c24$1@news.post.ch> References: <1169636785.504223.139630@j27g2000cwj.googlegroups.com> <45b8361a_5@news.bluewin.ch> <3pejpgfbki.fsf@hod.lan.m-e-leypold.de> NNTP-Posting-Host: 194.41.146.1 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: atlas.ip-plus.net 1170840617 19015 194.41.146.1 (7 Feb 2007 09:30:17 GMT) X-Complaints-To: abuse@ip-plus.net NNTP-Posting-Date: Wed, 7 Feb 2007 09:30:17 +0000 (UTC) User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) In-Reply-To: X-Original-NNTP-Posting-Host: w01iwt.pnet.ch X-Original-Trace: 7 Feb 2007 10:30:12 +0200, w01iwt.pnet.ch Xref: g2news2.google.com comp.lang.ada:9060 Date: 2007-02-07T10:30:11+01:00 List-Id: 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. And on Windows I know that only the full block allocated with MemAlloc can be returned. Blocks are always page sized (multiple of 4kb). A smart Memory manager might reserve a full block for large allocations but all those tiny 20 byte allocations will never be returned to the OS. > What I'm against is a GC "paradigm" that prevents me from having > deterministic "good bye" hooks for scoped lifetime. The problem is that > most GC-oriented languages I'm aware of do have this "issue". But isn't that exactly what "Unchecked_Deallocation" and "pragma Controlled" is all about? Has Ada - by your rationale - not got GC right? Martin