We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
删除节点的代码中_dic似乎是想要持有所有的Node,在队列中释放。
Node节点也注释说不持有前后节点,交给字典管理。
但是Map中的字典在赋值的时候用的却是__bridge,不转交对象管辖权,那么字典中的value应该无法持有Node节点才对?
@interface _YYLinkedMapNode : NSObject { @package __unsafe_unretained _YYLinkedMapNode *_prev; // retained by dic __unsafe_unretained _YYLinkedMapNode *_next; // retained by dic ... } @end ... - (void)insertNodeAtHead:(_YYLinkedMapNode *)node { CFDictionarySetValue(_dic, (__bridge const void *)(node->_key), (__bridge const void *)(node)); ... } - (void)removeAll { ... if (CFDictionaryGetCount(_dic) > 0) { CFMutableDictionaryRef holder = _dic; _dic = CFDictionaryCreateMutable(CFAllocatorGetDefault(), 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); if (_releaseAsynchronously) { dispatch_queue_t queue = _releaseOnMainThread ? dispatch_get_main_queue() : YYMemoryCacheGetReleaseQueue(); dispatch_async(queue, ^{ CFRelease(holder); // hold and release in specified queue }); } ... } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
删除节点的代码中_dic似乎是想要持有所有的Node,在队列中释放。
Node节点也注释说不持有前后节点,交给字典管理。
但是Map中的字典在赋值的时候用的却是__bridge,不转交对象管辖权,那么字典中的value应该无法持有Node节点才对?
The text was updated successfully, but these errors were encountered: