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,fc35bf7ba6fca42d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news.glorb.com!wns14feed!worldnet.att.net!12.120.4.37!attcg2!ip.att.net!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: Re: "new" word Date: 16 Mar 2005 05:36:27 -0600 Organization: LJK Software Message-ID: References: <1110966980.482176.111570@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1110972939 29524 192.135.80.34 (16 Mar 2005 11:35:39 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Wed, 16 Mar 2005 11:35:39 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:9469 Date: 2005-03-16T05:36:27-06:00 List-Id: In article <1110966980.482176.111570@f14g2000cwb.googlegroups.com>, "fabio de francesco" writes: > Ciao, > > While reading "the big online book of Linux Ada programming", by Ken O. > Burtch, I stopped at the following assertion > (http://www.pegasoft.ca/resources/boblap/13.html): > > "Usually you allocate memory with the Ada new statement. Where does new > get its memory? It uses the standard C library's malloc function." > > Does really Ada use Libc to implement "new"? Is it true? Of course not. Ada is a language standard, and allocates memory out of thin air. That memory has no physical reality and costs nothing. It is unlimited in size. Some particular Ada _implementation_ however, has to deal with physical memory. It is possible that some implementation might be layered on top of the C memory allocation facilities. > It seems absurd to me. I don't understand why Ada should depend on a C > standard library. Some operating systems are very C-centric in their operating system calls, and without direct experience I would say that Linux is likely one of them. I have seen "portable" C programs which spend half of their lines of code rolling their own version of facilities that are built into other operating systems.