• 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: Greg Parker <email@hidden>
  • Date: Fri, 11 Nov 2011 17:32:55 -0800

On Nov 11, 2011, at 5:02 PM, Don Quixote de la Mancha wrote:
> A colleague of mine reports that calloc() works correctly on his
> iPhone 3GS, in that it always returns NULL when he allocates too much
> memory.  He is then able to back out of all the allocations and exit
> his minimal test case App without it getting killed by the system.
>
> I suspect now that the death of my App is not due to the conscious
> design of Apple's iOS architects, but some other bug that occurs in my
> particular configuration.

malloc is a complicated system internally, and it's possible that some but not all allocation pathways fail to return NULL on error.

Some allocation paths depend on the requested block size.
Some allocation paths depend on the most recently freed block size, or on a longer history of previously freed blocks.
Some allocation paths depend on thread contention and CPU core affinity.

If you can write a test case that demonstrates a failure without the NULL return, feel free to file a bug report.


--
Greg Parker     email@hidden     Runtime Wrangler


_______________________________________________

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

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>)
 >Re: Allocating too much memory kills my App rather than returning NULL (From: Quincey Morris <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: Graham Cox <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: NSDateFormatter -initWithDateFormat:: vs. -init
  • 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