Re: problem encoding large float* matrix
Re: problem encoding large float* matrix
- Subject: Re: problem encoding large float* matrix
- From: Greg Guerin <email@hidden>
- Date: Tue, 1 Dec 2009 12:37:22 -0700
James Maxwell wrote:
NSUInteger coincsSize = maxCoincs * inputSize * sizeof(float);
NSData* coincData = [NSData dataWithBytesNoCopy:&coincidences
length:coincsSize];
[aCoder encodeBytes:[coincData bytes] length:coincsSize
forKey:@"coincidences"];
It makes no sense to go through an NSData object. You could just as
easily cast coincidences to a byte-pointer.
Besides, if coincidences is defined as type float*, then your use of
&coincidences to make the NSData is almost certainly wrong, and quite
likely the cause of the crash.
-- GG
_______________________________________________
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