• 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
Why does Swift crash my CFBitVector ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why does Swift crash my CFBitVector ?


  • Subject: Why does Swift crash my CFBitVector ?
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sun, 06 Jul 2014 16:14:14 +0700

class CrashVector
{
	let lengthInBits : CFIndex 	= 133 	//	must be > 128
	let badIndex : CFIndex 		= 129	//	128 ≤ badIndex < lengthInBits

	func makeCrash()
	{
		let bitVector = CFBitVectorCreateMutable( kCFAllocatorDefault, lengthInBits )
		let bitCount = CFBitVectorGetCount( bitVector )
		println("got BitVector with \(bitCount) bits")	//	why does it say 0 instead of 133 ?

		println("makeCrash will set bit \(badIndex) in BitVector of size \(lengthInBits)")	//	why does this crash ?
		CFBitVectorSetBitAtIndex( bitVector, badIndex, 1 )
	}
}

What am I doing wrong?

Gerriet.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Why does Swift crash my CFBitVector ?
      • From: "Clark S. Cox III" <email@hidden>
    • Re: Why does Swift crash my CFBitVector ?
      • From: Bavarious <email@hidden>
  • Prev by Date: Re: Is Swift really swift?
  • Next by Date: Re: Why does Swift crash my CFBitVector ?
  • Previous by thread: Re: Is Swift really swift?
  • Next by thread: Re: Why does Swift crash my CFBitVector ?
  • Index(es):
    • Date
    • Thread