delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/08/07:00:48

From: khan AT xraylith DOT wisc DOT edu (Mumit Khan)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Getting new to throw bad_alloc.
Date: 7 Feb 1999 23:17:54 GMT
Organization: Center for X-ray Lithography, UW-Madison
Lines: 19
Message-ID: <79l6v2$fp4$1@news.doit.wisc.edu>
References: <3 DOT 0 DOT 6 DOT 32 DOT 19990206235957 DOT 008ed6d0 AT pop DOT netaddress DOT com>
NNTP-Posting-Host: modi.xraylith.wisc.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <3 DOT 0 DOT 6 DOT 32 DOT 19990206235957 DOT 008ed6d0 AT pop DOT netaddress DOT com>,
Paul Derbyshire  <djgpp AT delorie DOT com> wrote:
>In djgpp 2.02, does new throw bad_alloc?

Depends on the compiler and runtime of course. EGCS-1.1.x does throw
bad_alloc. I have no idea what compiler comes with djgpp 2.02, so I
don't know if it's supposed to or not.

Older releases did not have standard compliant implementation.

>If not, how can this behavior be caused? By changing the default new handler?

Yes, and no. I recommend investing in the C++ ANSI/ISO standard document,
and a recent C++ text (eg., Stroustrup 3rd ed.). See Section 18.4 "Dynamic
Memory Management" in the standard for answers to your question.

Regards,
Mumit

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019