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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c32f6f0b23106020 X-Google-Attributes: gid103376,public From: dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner) Subject: Re: Large strings in ADA Date: 2000/04/17 Message-ID: <8dg13f$9281@news.cis.okstate.edu>#1/1 X-Deja-AN: 612430699 References: <38FB4521.D02EA4C9@xpress.se> <8dfonn$c1a$1@nnrp1.deja.com> Organization: Oklahoma State University User-Agent: slrn/0.9.6.2 (Linux) Reply-To: dstarner98@aasaa.ofe.org Newsgroups: comp.lang.ada Date: 2000-04-17T00:00:00+00:00 List-Id: On Mon, 17 Apr 2000 19:30:19 GMT, Robert Dewar wrote: >In article <38FB4521.D02EA4C9@xpress.se>, > Johan Groth wrote: >> tmoran@bix.com wrote: >> > >> > >Perhaps you should try duplicating the -exact- C semantics. >Presumably >> > >you have a -very- large char buffer into which the items >are copied. >> > >> > If the original is in C, it must have something like >> > char Msg[2500000]; // 2.5 MB >> > so the straightforward Ada equivalent would be >> > Msg : String(1 .. 2_500_000); -- 2.5 MB >> >> The above is the current solution but it doesn't work as it >uses to much >> memory. > > >That's odd, what machine are you on? Almost all operating >systems use commit-on-use allocation these days. Doesn't this try to get 2.5 MB from the stack, though? The C equivelent does, and I assumed that most Ada compilers (esp. GNAT) would just allocate arrays declared in a function/ procedure like that on the stack. -- David Starner - dstarner98@aasaa.ofe.org Only a nerd would worry about wrong parentheses with square brackets. But that's what mathematicians are. -- Dr. Burchard, math professor at OSU