• 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: NSData, CFData maximum length question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSData, CFData maximum length question


  • Subject: Re: NSData, CFData maximum length question
  • From: Seth Willits <email@hidden>
  • Date: Wed, 21 Mar 2012 23:12:29 -0700

On Mar 21, 2012, at 10:49 PM, Seth Willits wrote:

> On Mar 21, 2012, at 6:00 PM, Grandinetti Philip wrote:
>
>> I am confused about different behavior I'm seeing with CFData and NSData.    If I create a new project in XCode 4.3.1 as a Core Foundation command line tool, and enter the code below…
>
> You've triggered a bug!
>
> And it took me a long time, but I found it. The bug is in __CFDataRoundUpCapacity, and has to do with a bad (1 << ….) which should be (1L << …).
>
>
> I'll file a report.


Filed as 11097403. And yeah, setting the length to anything > 0 when the data is created will avoid the bug because the CFData is not  "growable", and CFDataSetLength is handled a little different for growable CFDatas vs fixed-length mutable ones.

I'm not sure what [NSMutableData dataWithCapacity:0] does, but it's not a simple call to CFDataCreateMutable(kCFAllocatorDefault, 0) which is why it behaves differently as well.


--
Seth Willits


_______________________________________________

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


  • Follow-Ups:
    • Re: NSData, CFData maximum length question
      • From: Ben Gollmer <email@hidden>
    • Re: NSData, CFData maximum length question
      • From: Wade Tregaskis <email@hidden>
References: 
 >NSData, CFData maximum length question (From: Grandinetti Philip <email@hidden>)
 >Re: NSData, CFData maximum length question (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: NSData, CFData maximum length question
  • Next by Date: Re: NSData, CFData maximum length question
  • Previous by thread: Re: NSData, CFData maximum length question
  • Next by thread: Re: NSData, CFData maximum length question
  • Index(es):
    • Date
    • Thread