Re: NSNotFound signed???
Re: NSNotFound signed???
- Subject: Re: NSNotFound signed???
- From: Jens Alfke <email@hidden>
- Date: Wed, 12 Jun 2013 09:51:17 -0700
On Jun 12, 2013, at 3:01 AM, Oleg Krupnov <email@hidden> wrote:
> You misunderstood, I wasn't talking about RAM. It was merely an
> illustration of how an assumption that seemed justified basing on some
> then current technical limits, in hindsight turned out ridiculous and
> crippling after the technical limits were pushed further.
It’s not a technical limit, it’s a mathematical limit. An n-bit address space simply cannot hold 2^n pointers. (I think the limit is 2^(n - n/8) … but of course even at that limit you wouldn’t have room for any objects for the pointers to point to!)
If you want to implement a sparse array that can support 2^64 items, go for it, but you’ll need some mechanism other than NSNotFound to indicate when a value isn’t found.
—Jens
_______________________________________________
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