feng9exe

Well, as Bavarious pointed out in a comment, Apple\'s actual CoreFoundation source is open and available for your perusal too. NSSet is implemented on top of CFSet, whose code is generated (as is that of CFDictionary) from a hash table template, using CFBasicHash to do the work. 

The difference between mutablility and immutability seems to be the matter of a flag in the structure (line 91 of CFBasicHash.h), and from my reading so far just affects calls to functions such as CFBasicHashAddValue; there\'s a simple check for the mutability. It seems likely, however, that Cobbal is right about the copy/retain behavior between the two (I just haven\'t read that far yet).

 

保证数据的唯一性。

 

https://stackoverflow.com/questions/5863510/nsset-implementation

分类:

技术点:

相关文章: