Re: Class gets EXC_BAD_ACCESS only as NSOperation
Re: Class gets EXC_BAD_ACCESS only as NSOperation
- Subject: Re: Class gets EXC_BAD_ACCESS only as NSOperation
- From: Bill Bumgarner <email@hidden>
- Date: Tue, 24 Mar 2009 10:29:17 -0700
On Mar 24, 2009, at 9:49 AM, James Maxwell wrote:
Ah, thanks. That makes sense, and it seems to be correct - I am
processing ***lots*** of data.
I just tried making the float arrays into instance variables,
wrapped in NSData objects, and it still crashes, only a little later
than before.
What's the best way of getting these arrays off the stack? I've got
several thousand of them to get through!
thanks for your help.
There really isn't a need to use an NSData for the arrays of stuff.
If they are just temporary to the local scope, then declare a float *
and malloc. You can still use your double-indexing to retrieve / set
values.
Something like:
float *x = (float *) malloc(sizeof(float) * columns * rows);
Or you could stick the same as an instance variable.
If it is still crashing, it is now for a different reason. Most
likely, memory corruption -- overrun a buffer somewhere?
b.bum
_______________________________________________
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