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-Thread: 103376,5117b1b6391a0e06 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 26 Jun 2004 10:26:58 -0500 Date: Sat, 26 Jun 2004 11:26:57 -0400 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: A simple ADA puzzle (I haven't the answer) References: <1087410710.477506@master.nyc.kbcfp.com> <8yXCc.548$Av3.500@nwrdny01.gnilink.net> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.90.114 X-Trace: sv3-Yky9toc44Uqqsdy+RnOnkW/7Ey0ilPV5oUp2KBVksXIhQEeffbld6XLArBqM63Rf7jRDDi8J0vfSnC5!Q6mr4dn1E3xX4rGtRFA0m1AGzRMtSJN6NZGZlOZLwrbC1NSmBxy1GsxpKETWSQ== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: g2news1.google.com comp.lang.ada:1924 Date: 2004-06-26T11:26:57-04:00 List-Id: Frank J. Lhota wrote: > I am quite sympathetic to that point of view. The problem, as indicated in > my previous post, is that for some types, the choice of whether one wants to > use the stack for these object is platform-specific. How does one code such > types in a portable way without allowing the compiler to choose the memory > allocation strategy? As noted before, pragmas and / or compiler options > could be used to override the compiler's default choice. Is there a downside > to this scheme? Is there an alternative scheme that would provide us with as > much portability? Yes, and that is what has been chosen for Ada 0Y. The container library will/should be the normal way of creating these unbounded objects in Ada 0Y, and different implementations of the container library should give Frank what he wants. Of course, if you want no implicit heap allocation, and types with potentially huge sizes, there will still be no workable solution on some systems. But in that case, it is the nature of the problem. Incidently, now that AMD is selling lots of AMD64 chips, and Intel will soon be shipping Pentium 4s with their version of the same ISA, allocating the max for a string with a 32-bit Integer index will not necessarily raise Storage_Error. (You can do this on other architectures such as UltraSPARC and PowerPC as well.) In fact, you should be able to allocate thousands of such objects, and let the virtual memory system deal with extending any particular string. So even today, the code the OP was working with may allocate the max and still work on some architectures. ;-) -- Robert I. Eachus "Reason and experience both forbid us to expect that national morality can prevail in exclusion of religious principles." -- George Washington