GCC begins move to C++
GCC begins move to C++
Posted Jun 2, 2010 18:01 UTC (Wed) by Cyberax (✭ supporter ✭, #52523)In reply to: GCC begins move to C++ by dgm
Parent article: GCC begins move to C++
Is it better than a thrown exception?
Posted Jun 3, 2010 21:07 UTC (Thu)
by khim (subscriber, #9252)
[Link]
This is exactly why you CAN'T write such code in gcc. malloc is forbidden there at include file level. Instead you'll use xmalloc - it can not ever return NULL, so there are no need to check the error code.
Posted Jun 4, 2010 9:46 UTC (Fri)
by jrn (subscriber, #64214)
[Link] (1 responses)
On Linux, this is true but mostly irrelevant. Most systems overcommit (it is hard to find a saner thing to do if the user wants large programs to be able to fork() but does not provide the swap to back them) and malloc almost never fails.
Posted Jun 7, 2010 9:47 UTC (Mon)
by nye (subscriber, #51576)
[Link]
You are right of course...
malloc() failure
malloc() failure