• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Allocating too much memory kills my App rather than returning NULL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Allocating too much memory kills my App rather than returning NULL
      • From: Martin Wierschin <email@hidden>
References: 
 >Allocating too much memory kills my App rather than returning NULL (From: Don Quixote de la Mancha <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Jens Alfke <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Don Quixote de la Mancha <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Greg Parker <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Wade Tregaskis <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Joar Wingfors <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Don Quixote de la Mancha <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Conrad Shultz <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Don Quixote de la Mancha <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Dave Camp <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: James Montgomerie <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Kyle Sluder <email@hidden>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Don Quixote de la Mancha <email@hidden>)

  • Prev by Date: Re: Allocating too much memory kills my App rather than returning NULL
  • Next by Date: Re: Allocating too much memory kills my App rather than returning NULL
  • Previous by thread: Re: Allocating too much memory kills my App rather than returning NULL
  • Next by thread: Re: Allocating too much memory kills my App rather than returning NULL
  • Index(es):
    • Date
    • Thread