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,23ace43a488fab29 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: function "&" for strings type cause memory problem. References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 10 Nov 2005 20:45:17 GMT NNTP-Posting-Host: 67.3.219.182 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1131655517 67.3.219.182 (Thu, 10 Nov 2005 12:45:17 PST) NNTP-Posting-Date: Thu, 10 Nov 2005 12:45:17 PST Xref: g2news1.google.com comp.lang.ada:6339 Date: 2005-11-10T20:45:17+00:00 List-Id: bubble wrote: type access_string is access all String; > String1 : String := (1 .. 10_000_000 => 'a'); > String2 : String := (1 .. 10_000_000 => 'b'); > > Nstring2 := new String'(String1 & String2); "&" is probably creating its result on the stack, and there's not enough space for a 20-million-character string on your stack, resulting in Storage_Error. You can check the GNAT sources if you want to be sure. You could allocate the space and copy the 2 strings in separately, similar to what you do in your 1st test. Do you really have 10-million-character strings, or are you allocating enough for the maximum from VB? If the latter, you can allocate just the amount you need. Ada is good at that. -- Jeff Carter "It's symbolic of his struggle against reality." Monty Python's Life of Brian 78