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: Don Quixote de la Mancha <email@hidden>
- Date: Fri, 11 Nov 2011 18:06:14 -0800
On Fri, Nov 11, 2011 at 5:25 PM, Greg Parker <email@hidden> wrote:
> Did you actually write the minimal test you described? If you had, you would have discovered that setrlimit(RLIMIT_DATA) does not limit malloc memory.
>
> That's one reason why we ask bug reports to include test cases.
To call setrlimit() was not the cause of the Simulator bug, but my
suggested fix for it.
My reading of the setrlimit() man page suggested it would fix the bug,
not allow it to be reproduced.
OK, I'll take your bet and raise you:
Have the Simulator instead allocate a single fixed-sized buffer that
is more or less the size of the virtual memory that would be available
to Apps on real devices, then have the Simulator's malloc() pass out
chunks of just that one buffer, without ever asking Mac OS X for more
virtual memory.
> armv6 or armv7? There's a known LLVM 3.0 codegen bug for armv6 Thumb. Workaround is to
> disable Thumb.
Both of the devices I reproduced it with have ARM Cortex A8 CPUs, so
armv7 - the first-generation iPad and iPhone 4.
I also have a first-gen iPhone, which is armv6, but have not yet tested it.
I did come across some reports that Thumb for armv6 is broken, and
figured that even though this was armv7, but I have not yet been able
to figure out how to disable Thumb in Apple's LLVM 3.0 compiler for
Xcode 4.2. The way one does it for GCC has no effect on LLVM.
If you can enlighten me, I'll give it a try right after I get back from supper.
--
Don Quixote de la Mancha
Dulcinea Technologies Corporation
Software of Elegance and Beauty
http://www.dulcineatech.com
email@hidden
_______________________________________________
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