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-06-30 08:27:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!213.200.246.247!not-for-mail From: Vinzent Hoefler Newsgroups: comp.lang.ada Subject: Re: Help-memory allocation Date: Mon, 30 Jun 2003 17:25:22 +0200 Organization: JeLlyFish software Message-ID: References: <87y8zjvckv.fsf@deneb.enyo.de> Reply-To: v.hoefler@acm.org NNTP-Posting-Host: 213.200.246.247 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: fu-berlin.de 1056986828 32975058 213.200.246.247 (16 [175126]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:39933 Date: 2003-06-30T17:25:22+02:00 List-Id: =46lorian Weimer wrote: >Vinzent Hoefler writes: > >>>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? >> >> I'd say, it raises the Storage_Error exception. > >In conforming implementations, yes. However, many Ada implementations >will only raise Storage_Error at some later point in the execution of >the program ("commit on allocate" vs. "commit on use"). Mmh, so in case someone relies on the occurence of the exception in the very moment of the allocation, would it be wise to also give an initial value to make sure we actually "use" the allocated memory? Vinzent.