• 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: problem encoding large float* matrix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: problem encoding large float* matrix
  • Next by Date: Re: problem encoding large float* matrix
  • Previous by thread: Re: problem encoding large float* matrix
  • Next by thread: Re: problem encoding large float* matrix
  • Index(es):
    • Date
    • Thread