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     gpar...@apple.com     Runtime Wrangler


_______________________________________________

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