delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/08/07:54:17

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Organization: Materials Science Centre
To: DJGPP AT delorie DOT com
Date: Mon, 8 Jul 1996 12:49:03 GMT
Subject: What if I run out of store?
Message-ID: <19C7E4A0FB5@fs2.mt.umist.ac.uk>

  Excuse me if this query is rather faqqish, but, since in version 2 I am not
allowed indefinite heap size:-
  (1) In (a) version 1, (b) in version 2, (c) in C and C++ in general
including non-Gnu compilers, what happens if I call `new <typename>', or
malloc(), and there is not enough space available, what happens? I used to
think that it merely returns 0, but after finding this function in
c:\djgpp\libsrc\gcc\src\libgcc2.c_:-
  void _default_new_handler(){write(2,MESSAGE,sizeof(MESSAGE)); _exit(-1);}
  I no longer feel so certain.

  (2) How can I trap the error condition of the stack running out of space?

  Please reply to me in person, as I had to unsubscribe from djgpp email group
due to email intray overload.

- Raw text -


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