Re: Allocating too much memory kills my App rather than returning NULL
Re: Allocating too much memory kills my App rather than returning NULL
- Subject: Re: Allocating too much memory kills my App rather than returning NULL
- From: Kyle Sluder <email@hidden>
- Date: Thu, 10 Nov 2011 18:40:01 -0800
On Thu, Nov 10, 2011 at 6:03 PM, Don Quixote de la Mancha
<email@hidden> wrote:
> 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.
Because calloc and malloc never return, they are not violating the spec.
Nothing about the POSIX spec requires these functions to return. _If_
they return, they must either return a suitably-aligned pointer or
NULL (unless they were passed a size of 0, in which case the result is
implementation-defined).
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden