{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift/pulls/comments/84384288","pull_request_review_id":5166905,"id":84384288,"diff_hunk":"@@ -4240,22 +4203,19 @@ internal enum _Variant${Self}Storage<${TypeParametersDecl}> : _HashStorage {\n %elif Self == 'Dictionary':\n     let oldValue = nativeStorage.value(at: index.offset)\n %end\n-    nativeDeleteImpl(nativeStorage, idealBucket: idealBucket,\n+    nativeDelete(nativeStorage, idealBucket: idealBucket,\n       offset: index.offset)\n     return oldValue\n   }\n \n   internal mutating func nativeRemove(\n     at nativeIndex: NativeIndex\n   ) -> SequenceElement {\n-    var nativeStorage = asNative\n \n     // The provided index should be valid, so we will always mutating the\n     // set storage.  Request unique storage.\n-    let (reallocated, _) = ensureUniqueNativeStorage(nativeStorage.capacity)\n-    if reallocated {\n-      nativeStorage = asNative","path":"stdlib/public/core/HashedCollections.swift.gyb","position":2380,"original_position":1333,"commit_id":"940e71ee3895c258f55d6a659cc235d58b47ecba","original_commit_id":"cae4ce75806be163f4d9ca9049a5020f46db1dc6","user":{"login":"Gankro","id":1136864,"avatar_url":"https://avatars.githubusercontent.com/u/1136864?v=3","gravatar_id":"","url":"https://api.github.com/users/Gankro","html_url":"https://github.com/Gankro","followers_url":"https://api.github.com/users/Gankro/followers","following_url":"https://api.github.com/users/Gankro/following{/other_user}","gists_url":"https://api.github.com/users/Gankro/gists{/gist_id}","starred_url":"https://api.github.com/users/Gankro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gankro/subscriptions","organizations_url":"https://api.github.com/users/Gankro/orgs","repos_url":"https://api.github.com/users/Gankro/repos","events_url":"https://api.github.com/users/Gankro/events{/privacy}","received_events_url":"https://api.github.com/users/Gankro/received_events","type":"User","site_admin":false},"body":"I believe this is no longer relevant with the double-indirection model removed. It was probably fixing up some redundant encoding? That or it was gibberish.","created_at":"2016-10-20T21:57:00Z","updated_at":"2016-10-20T21:57:00Z","html_url":"https://github.com/apple/swift/pull/5291#discussion_r84384288","pull_request_url":"https://api.github.com/repos/apple/swift/pulls/5291","_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/comments/84384288"},"html":{"href":"https://github.com/apple/swift/pull/5291#discussion_r84384288"},"pull_request":{"href":"https://api.github.com/repos/apple/swift/pulls/5291"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/5291","id":89392022,"html_url":"https://github.com/apple/swift/pull/5291","diff_url":"https://github.com/apple/swift/pull/5291.diff","patch_url":"https://github.com/apple/swift/pull/5291.patch","issue_url":"https://api.github.com/repos/apple/swift/issues/5291","number":5291,"state":"open","locked":false,"title":"[stdlib] Rewriting native hashed collection indices (rebased)","user":{"login":"Gankro","id":1136864,"avatar_url":"https://avatars.githubusercontent.com/u/1136864?v=3","gravatar_id":"","url":"https://api.github.com/users/Gankro","html_url":"https://github.com/Gankro","followers_url":"https://api.github.com/users/Gankro/followers","following_url":"https://api.github.com/users/Gankro/following{/other_user}","gists_url":"https://api.github.com/users/Gankro/gists{/gist_id}","starred_url":"https://api.github.com/users/Gankro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gankro/subscriptions","organizations_url":"https://api.github.com/users/Gankro/orgs","repos_url":"https://api.github.com/users/Gankro/repos","events_url":"https://api.github.com/users/Gankro/events{/privacy}","received_events_url":"https://api.github.com/users/Gankro/received_events","type":"User","site_admin":false},"body":"<!-- What's in this pull request? -->\r\n\r\nThis is a rebase of #3046. The majority of the work here is @austinzheng's, and can be found in the first commit. However the codebase had changed enough that the patch had to be significantly modified. I'm mostly relying on the test suite to verify that there weren't errors in resolving all the conflicts.\r\n\r\n    Changes:\r\n    - Native dictionary and set indices no longer hold references to storage\r\n    - Cocoa-based dictionary and set indices no longer hold references to storage\r\n    - Removed double indirection trick from hashed collections\r\n    - Rewrote storage types to reflect simpler model\r\n    - Updated unit tests\r\n\r\nAs a consequence of removing the double indirection, Dictionary -> NSDictionary now always requires an allocation for a wrapper class. This means that if you bridge a Dictionary multiple times, the resultant NSDictionaries will not be referentially identical. I briefly investigated trying to restore the previous behaviour; or at least perform the optimizations that Array does to make the verbatim-bridgeable case free. \r\n\r\nDiscussion with @dabrahams lead to the conclusion that restoring the previous behaviour isn't necessary or even strictly desirable. In particular, the old behaviour could lead to the bridged buffer being kept alive much longer than necessary. This design ensures those are cleaned up as soon as possible. \r\n\r\nMy own research into adopting Array's optimization appears to be infeasible, as _NativeDictionaryStorage already inherits from ManagedBuffer, and so can't inherit from _NSDictionaryCore as well (right?).\r\n\r\nStill, it should be noted that this will almost certainly lead to regressions in bridging performance. At least in micro-benchmarks. \r\n\r\nIt should also be noted that this redesign is necessary for soundness, as the double-indirection design is unsound for multi-threading (as discussed in SE-0065: https://github.com/apple/swift-evolution/blob/master/proposals/0065-collections-move-indices.md). \r\n\r\n<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: \r\nResolves [SR-NNNN](https://bugs.swift.org/browse/SR-NNNN). -->\r\n\r\n<!--\r\nBefore merging this pull request, you must run the Swift continuous integration tests.\r\nFor information about triggering CI builds via @swift-ci, see:\r\nhttps://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci\r\n\r\nThank you for your contribution to Swift!\r\n-->\r\n\r\nTODO before merge:\r\n\r\n* [x] re-instate empty-collection-singleton\r\n* [x] fix comparison change\r\n* [ ] evaluate benches\r\n* [ ] fix documentation","created_at":"2016-10-14T14:14:39Z","updated_at":"2016-10-20T21:57:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80d0efd6337d8187c7fa9e915f6f19cd4a80f903","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift/pulls/5291/commits","review_comments_url":"https://api.github.com/repos/apple/swift/pulls/5291/comments","review_comment_url":"https://api.github.com/repos/apple/swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift/issues/5291/comments","statuses_url":"https://api.github.com/repos/apple/swift/statuses/940e71ee3895c258f55d6a659cc235d58b47ecba","head":{"label":"Gankro:dsindex","ref":"dsindex","sha":"940e71ee3895c258f55d6a659cc235d58b47ecba","user":{"login":"Gankro","id":1136864,"avatar_url":"https://avatars.githubusercontent.com/u/1136864?v=3","gravatar_id":"","url":"https://api.github.com/users/Gankro","html_url":"https://github.com/Gankro","followers_url":"https://api.github.com/users/Gankro/followers","following_url":"https://api.github.com/users/Gankro/following{/other_user}","gists_url":"https://api.github.com/users/Gankro/gists{/gist_id}","starred_url":"https://api.github.com/users/Gankro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gankro/subscriptions","organizations_url":"https://api.github.com/users/Gankro/orgs","repos_url":"https://api.github.com/users/Gankro/repos","events_url":"https://api.github.com/users/Gankro/events{/privacy}","received_events_url":"https://api.github.com/users/Gankro/received_events","type":"User","site_admin":false},"repo":{"id":68046246,"name":"swift","full_name":"Gankro/swift","owner":{"login":"Gankro","id":1136864,"avatar_url":"https://avatars.githubusercontent.com/u/1136864?v=3","gravatar_id":"","url":"https://api.github.com/users/Gankro","html_url":"https://github.com/Gankro","followers_url":"https://api.github.com/users/Gankro/followers","following_url":"https://api.github.com/users/Gankro/following{/other_user}","gists_url":"https://api.github.com/users/Gankro/gists{/gist_id}","starred_url":"https://api.github.com/users/Gankro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gankro/subscriptions","organizations_url":"https://api.github.com/users/Gankro/orgs","repos_url":"https://api.github.com/users/Gankro/repos","events_url":"https://api.github.com/users/Gankro/events{/privacy}","received_events_url":"https://api.github.com/users/Gankro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gankro/swift","description":"The Swift Programming Language","fork":true,"url":"https://api.github.com/repos/Gankro/swift","forks_url":"https://api.github.com/repos/Gankro/swift/forks","keys_url":"https://api.github.com/repos/Gankro/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gankro/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gankro/swift/teams","hooks_url":"https://api.github.com/repos/Gankro/swift/hooks","issue_events_url":"https://api.github.com/repos/Gankro/swift/issues/events{/number}","events_url":"https://api.github.com/repos/Gankro/swift/events","assignees_url":"https://api.github.com/repos/Gankro/swift/assignees{/user}","branches_url":"https://api.github.com/repos/Gankro/swift/branches{/branch}","tags_url":"https://api.github.com/repos/Gankro/swift/tags","blobs_url":"https://api.github.com/repos/Gankro/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gankro/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gankro/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gankro/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gankro/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/Gankro/swift/languages","stargazers_url":"https://api.github.com/repos/Gankro/swift/stargazers","contributors_url":"https://api.github.com/repos/Gankro/swift/contributors","subscribers_url":"https://api.github.com/repos/Gankro/swift/subscribers","subscription_url":"https://api.github.com/repos/Gankro/swift/subscription","commits_url":"https://api.github.com/repos/Gankro/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gankro/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gankro/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gankro/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gankro/swift/contents/{+path}","compare_url":"https://api.github.com/repos/Gankro/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gankro/swift/merges","archive_url":"https://api.github.com/repos/Gankro/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gankro/swift/downloads","issues_url":"https://api.github.com/repos/Gankro/swift/issues{/number}","pulls_url":"https://api.github.com/repos/Gankro/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/Gankro/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/Gankro/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gankro/swift/labels{/name}","releases_url":"https://api.github.com/repos/Gankro/swift/releases{/id}","deployments_url":"https://api.github.com/repos/Gankro/swift/deployments","created_at":"2016-09-12T20:45:50Z","updated_at":"2016-09-12T20:46:14Z","pushed_at":"2016-10-19T22:55:10Z","git_url":"git://github.com/Gankro/swift.git","ssh_url":"git@github.com:Gankro/swift.git","clone_url":"https://github.com/Gankro/swift.git","svn_url":"https://github.com/Gankro/swift","homepage":"https://swift.org/","size":125118,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apple:master","ref":"master","sha":"d7c389e903b8879a4c324451d59815daa69b3b39","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838949,"name":"swift","full_name":"apple/swift","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift/deployments","created_at":"2015-10-23T21:15:07Z","updated_at":"2016-10-20T21:41:00Z","pushed_at":"2016-10-20T21:52:07Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"https://swift.org/","size":190227,"stargazers_count":34630,"watchers_count":34630,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4972,"mirror_url":null,"open_issues_count":103,"forks":4972,"open_issues":103,"watchers":34630,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/5291"},"html":{"href":"https://github.com/apple/swift/pull/5291"},"issue":{"href":"https://api.github.com/repos/apple/swift/issues/5291"},"comments":{"href":"https://api.github.com/repos/apple/swift/issues/5291/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift/pulls/5291/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift/pulls/5291/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift/statuses/940e71ee3895c258f55d6a659cc235d58b47ecba"}}}}
{"actor":{"display_login":"Gankro"}}