On Thu, Nov 10, 2011 at 9:52 AM, Kyle Sluder <kyle.slu...@gmail.com> wrote:
> Read carefully: “If you allocate memory faster than the OS can re-claim it 
> from other processes…” In other words, the system protects against apps that 
> might've gotten trapped in an infinite loop of allocating memory. Better to 
> kill the errant app without sacrificing other apps to its unsatisfiable 
> demands.

I don't have a problem with the system killing runaway processes.
What I have a problem with is that calloc() NEVER returns NULL.  If it
ever did, I would have plenty of opportunity to deallocate ALL of the
memory I just allocated, and stop attempting to allocate any more.

Instead of ever receiving an allocation failure, my process is just killed.

My process isn't killed by a UNIX signal.  If it were I could use a
signal handler to free up all that memory.

calloc() and malloc() are documented to return NULL when there isn't
enough memory to satisfy the user's request.  Their implementation is
simply broken if they don't do that.
-- 
Don Quixote de la Mancha
Dulcinea Technologies Corporation
Software of Elegance and Beauty
http://www.dulcineatech.com
quix...@dulcineatech.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to