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: a07f3367d7,aba1514f4a1fc450 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.74.69 with SMTP id r5mr2768495pav.12.1345588346730; Tue, 21 Aug 2012 15:32:26 -0700 (PDT) Received: by 10.224.96.8 with SMTP id f8mr3550738qan.7.1345588346570; Tue, 21 Aug 2012 15:32:26 -0700 (PDT) Path: a5ni2pbv.0!nntp.google.com!news1.google.com!u3no29359137qai.0!news-out.google.com!c6ni214261826qas.0!nntp.google.com!newsfeed2.dallas1.level3.net!news.level3.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.arch,comp.lang.ada Subject: Re: Have the Itanium critics all been proven wrong? Date: Tue, 21 Aug 2012 18:32:18 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <5021874F.1747D0BF@sonic.net> <1e1tf9-0kp2.ln1@ntp6.tmsw.no> <46f19bfc-930e-4f06-b5a6-c60f39cfda0c@p14g2000yqk.googlegroups.com> <077b12f6-1196-4b5c-bbdb-04291b1ae616@q22g2000vbx.googlegroups.com> <589825d2-d998-456a-9c37-c8ae13e1e7bc@e29g2000vbm.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1345588346 29629 192.74.137.71 (21 Aug 2012 22:32:26 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 21 Aug 2012 22:32:26 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:2jX7D7NmfyGuGw+0NchXjPfbnJ8= Content-Type: text/plain; charset=us-ascii Date: 2012-08-21T18:32:18-04:00 List-Id: Niklas Holsti writes: > As far as I know, the only Ada systems with automatic garbage collection > are those that compile Ada to Java byte-code and run on the JVM. Or .NET. >...I have > heard that some people have used the Boehm "conservative" GC with Ada, > but I'm not sure if it works reliably (because some Ada compilers play > tricks with array base addresses). I have used the Boehm GC with Ada compiled with GNAT. It works. But I wouldn't use it in a real-time/embedded/safety-critical program. Boehm GC doesn't work very well if the amount of memory you use is a large fraction of the virtual address space. This is because of the way "blacklisting" works. If the GC runs across the value 12345000, which might be a pointer to a heap object, it checks whether something has been allocated at that address. If not, it black-lists that page of virtual memory, which means it refuses to ever allocate any heap object on that page. That means 12345000 can never be mistaken for a pointer. So large chunks of virtual memory get black listed. I had problems with that years ago, on 32-bit machines with heap sizes in the hundreds of megabytes. But on a 64-bit machine, it's not a problem -- nobody can afford enough RAM to make up (say) 10% of the virtual address space. Anyway, this isn't Ada specific -- Boehm GC works that way with all languages. > Unchecked_Deallocation is used a lot. Another alternative in Ada is storage pools (sometimes called "region-based memory management). Not 100% safe in Ada, but much safer and much more efficient than Unchecked_Deallocation (in cases where storage pools are appropriate). - Bob