From: Mikhael G. <mi...@ho...> - 2001-10-31 10:34:22
|
On 30 Oct 2001 15:56:34 +0100, Pawel Kot wrote: > > On Tue, 30 Oct 2001, Vitezslav Samel wrote: > > > - test for return values form syscalls and library calls (malloc(), > > etc.) > > malloc on at least linux _never_ fails. If there's not enough > memory it just delays the allocation till it is needed. > But agreed that retvals should be checked in good programming style. Another programming practice in this case is to replace all allocation functions (malloc -> safemalloc), so they always pass, like here: ftp://ftp.fvwm.org/pub/fvwm/devel/sources/libs/safemalloc.c Usually if there is no memory, the program can't function and should exit. Regards, Mikhael. |