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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c1b1b81e16e83802 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-02 08:57:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newshub.sdsu.edu!elnk-pas-nf2!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Help-memory allocation Date: Wed, 02 Jul 2003 08:59:45 -0700 Organization: AdaWorks Software Engineering Message-ID: <3F030171.1CC4CEE8@adaworks.com> References: Reply-To: richard@adaworks.com NNTP-Posting-Host: 3f.bb.88.f6 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 2 Jul 2003 15:57:05 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:39978 Date: 2003-07-02T15:57:05+00:00 List-Id: prashna wrote: > Hi all, > How to check whether the memory is allocated or not when using new > operator?in other words, what the operator "new" returns if memory > allocation fails?Surprisingly no tutorial or book mentions what it > returns or is that this "new"(Ada) is entirely different from C++ > "new" or C's malloc. > Any pointers on this will be appreciated. Where this could be a problem, use the Storage_Pools package. GNAT has a default version of this. I think other compiler publishers should have a default version, but not all do. There is a great example of how to use this package in John Barnes' book. Also, several people (Pat Rogers or Jim Rogers?) have posted good examples in this forum. Richard Riehle