Re: What to do when malloc() returns 0?
Subject: Re: What to do when malloc() returns 0?
From: email@example.com (Eric W. Sink)
Date: Thu, 21 Jul 1994 08:11:11 -0600
> E. Support "malloc failed" return code throughout the library
> - requires significant library reengineering
> - error prone
> - requires library clients to do lots of error checking
> + suitable for use in robust applications
I cast my vote for this. A and B are not robust, and both C and D
also require significant library reengineering. E is clean, can be
done readably, and very portable.
I agree with Phillip too, the library should propagate errors of all
kinds, not just malloc failures.
Eric W. Sink, Software Engineer -- firstname.lastname@example.org 217-355-6000 ext 237
All opinions expressed are mine, and may not be those of my employer.
Hakuna Patata (no french fries)