Re: CFMutableDictionary Capacity
Re: CFMutableDictionary Capacity
- Subject: Re: CFMutableDictionary Capacity
- From: Jens Alfke <email@hidden>
- Date: Wed, 20 Jul 2011 15:30:33 -0700
On Jul 20, 2011, at 2:34 PM, Andreas Grosam wrote:
> According the doc, the parameter "capacity" in function CFDictionaryCreateMutable() sets the *maximum number* of key-value pairs which can be inserted into the container. That is, it's not an *initial* capacity.
I think that was a mistake in the docs. The comment in CFDictionary.h in the 10.7 SDK says:
@param capacity A hint about the number of values that will be held
by the CFDictionary. Pass 0 for no hint. The implementation may
ignore this hint, or may use it to optimize various
operations. A dictionary's actual capacity is only limited by
address space and available memory constraints). If this
parameter is negative, the behavior is undefined.
Since CFDictionary and NSDictionary have the same implementation under the hood, I think the capacity will have the same effect at runtime whichever API you use.
—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