Mail Archives: djgpp/1999/02/08/07:00:48
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 -