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,be7fa91648ac3f12 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!newspeer1-win.ntli.net!newsfe1-win.ntli.net.POSTED!53ab2750!not-for-mail From: "Dr. Adrian Wrigley" Subject: Re: Large arrays (again), problem case for GNAT User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.ada References: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Fri, 15 Apr 2005 11:49:23 GMT NNTP-Posting-Host: 81.100.88.147 X-Complaints-To: http://www.ntlworld.com/netreport X-Trace: newsfe1-win.ntli.net 1113565763 81.100.88.147 (Fri, 15 Apr 2005 12:49:23 BST) NNTP-Posting-Date: Fri, 15 Apr 2005 12:49:23 BST Organization: ntl Cablemodem News Service Xref: g2news1.google.com comp.lang.ada:10496 Date: 2005-04-15T11:49:23+00:00 List-Id: On Fri, 15 Apr 2005 00:21:50 -0500, Randy Brukardt wrote: > My pool expands > the arrays by rewriting the dope of the arrays passed into the functions - > something that no one should ever do unless they're the author of the > compiler. And probably not even then. I did this a lot a few years ago with GNAT. It worked extremely well. (no I'm not the author of the compiler!) I couldn't understand why there was no decent mechanism for changing the size of an array. The resulting code was much cleaner, faster and more memory efficient than using fancy data structures/container libraries. Why did the language not provide an equivalent of 'realloc' for arrays? What is the best work-around? Are we supposed to allocate a completely new array and copy everything over, and deallocate the old? Does Ada 2005 really help give efficient resizable arrays at all? Thanks for views! -- Adrian Wrigley, Cambridge, uk. (one uk in email address!)