{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/comments/71066093","id":71066093,"diff_hunk":"@@ -38,51 +43,50 @@ public struct DispatchData : RandomAccessCollection {\n \t\t\t}\n \t\t}\n \t}\n-#endif\n-\tinternal var __wrapped: dispatch_data_t\n+\n+\tinternal var __wrapped: __DispatchData\n \n \t/// Initialize a `Data` with copied memory content.\n \t///\n \t/// - parameter bytes: A pointer to the memory. It will be copied.\n \t/// - parameter count: The number of bytes to copy.\n \tpublic init(bytes buffer: UnsafeBufferPointer<UInt8>) {\n-\t\t__wrapped = dispatch_data_create(\n-\t\t\tbuffer.baseAddress!, buffer.count, nil, _dispatch_data_destructor_default())\n+\t\tlet d = dispatch_data_create(buffer.baseAddress!, buffer.count, nil, _dispatch_data_destructor_default())\n+\t\tself.init(data: d)","path":"src/swift/Data.swift","position":40,"original_position":40,"commit_id":"4ac4f463d091830c2054f1bfea5125e2d9c64722","original_commit_id":"4ac4f463d091830c2054f1bfea5125e2d9c64722","user":{"login":"dgrove-oss","id":5099100,"avatar_url":"https://avatars.githubusercontent.com/u/5099100?v=3","gravatar_id":"","url":"https://api.github.com/users/dgrove-oss","html_url":"https://github.com/dgrove-oss","followers_url":"https://api.github.com/users/dgrove-oss/followers","following_url":"https://api.github.com/users/dgrove-oss/following{/other_user}","gists_url":"https://api.github.com/users/dgrove-oss/gists{/gist_id}","starred_url":"https://api.github.com/users/dgrove-oss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgrove-oss/subscriptions","organizations_url":"https://api.github.com/users/dgrove-oss/orgs","repos_url":"https://api.github.com/users/dgrove-oss/repos","events_url":"https://api.github.com/users/dgrove-oss/events{/privacy}","received_events_url":"https://api.github.com/users/dgrove-oss/received_events","type":"User","site_admin":false},"body":"Compiler doesn't complain.  I think it is allowed because this init is public and the init being calling with self.init is internal.  (or there's a compiler bug...)\r\n","created_at":"2016-07-16T13:36:17Z","updated_at":"2016-07-16T13:36:17Z","html_url":"https://github.com/apple/swift-corelibs-libdispatch/pull/108#discussion_r71066093","pull_request_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/comments/71066093"},"html":{"href":"https://github.com/apple/swift-corelibs-libdispatch/pull/108#discussion_r71066093"},"pull_request":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/108","id":77678753,"html_url":"https://github.com/apple/swift-corelibs-libdispatch/pull/108","diff_url":"https://github.com/apple/swift-corelibs-libdispatch/pull/108.diff","patch_url":"https://github.com/apple/swift-corelibs-libdispatch/pull/108.patch","issue_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/108","number":108,"state":"open","locked":false,"title":"deallocation support for DispatchData on Linux","user":{"login":"dgrove-oss","id":5099100,"avatar_url":"https://avatars.githubusercontent.com/u/5099100?v=3","gravatar_id":"","url":"https://api.github.com/users/dgrove-oss","html_url":"https://github.com/dgrove-oss","followers_url":"https://api.github.com/users/dgrove-oss/followers","following_url":"https://api.github.com/users/dgrove-oss/following{/other_user}","gists_url":"https://api.github.com/users/dgrove-oss/gists{/gist_id}","starred_url":"https://api.github.com/users/dgrove-oss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgrove-oss/subscriptions","organizations_url":"https://api.github.com/users/dgrove-oss/orgs","repos_url":"https://api.github.com/users/dgrove-oss/repos","events_url":"https://api.github.com/users/dgrove-oss/events{/privacy}","received_events_url":"https://api.github.com/users/dgrove-oss/received_events","type":"User","site_admin":false},"body":"Deallocation / reference counting support for DispatchData\r\nin the wrapping overlay consisting of two main pieces.\r\n\r\nFirst, since DispatchData is a struct and dispatch_data_t is\r\na COpaquePointer, we need an intermediate class __DispatchData\r\non which to perform the reference counting operations to enable\r\nthe backing _dispatch_data_t to be deallocated when they are no\r\nlonger reachable.  I overlooked the mapping of _dispatch_data_t\r\nto OS_dispatch_data in Dispatch.apinotes in my initial pull request\r\nfor the wrapping overlay and as a result all the dispatch_data_t\r\ninstances were not being reference counted.\r\n\r\nSecond, enable the DispatchData.Deallocator portion of the API.\r\nAfter some experimentation, found a way to have the desired API\r\nwithout getting a reference to _TMBO in the generated code.\r\nLeft a FIXME because the current approach is sub-optimal in where\r\nit converts from Swift blocks to @convention(block) blocks.","created_at":"2016-07-15T21:08:25Z","updated_at":"2016-07-16T13:36:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6b32563fe513d91c285078f02f5e52a5bd304ca","assignee":{"login":"mwwa","id":16230086,"avatar_url":"https://avatars.githubusercontent.com/u/16230086?v=3","gravatar_id":"","url":"https://api.github.com/users/mwwa","html_url":"https://github.com/mwwa","followers_url":"https://api.github.com/users/mwwa/followers","following_url":"https://api.github.com/users/mwwa/following{/other_user}","gists_url":"https://api.github.com/users/mwwa/gists{/gist_id}","starred_url":"https://api.github.com/users/mwwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwwa/subscriptions","organizations_url":"https://api.github.com/users/mwwa/orgs","repos_url":"https://api.github.com/users/mwwa/repos","events_url":"https://api.github.com/users/mwwa/events{/privacy}","received_events_url":"https://api.github.com/users/mwwa/received_events","type":"User","site_admin":false},"assignees":[{"login":"mwwa","id":16230086,"avatar_url":"https://avatars.githubusercontent.com/u/16230086?v=3","gravatar_id":"","url":"https://api.github.com/users/mwwa","html_url":"https://github.com/mwwa","followers_url":"https://api.github.com/users/mwwa/followers","following_url":"https://api.github.com/users/mwwa/following{/other_user}","gists_url":"https://api.github.com/users/mwwa/gists{/gist_id}","starred_url":"https://api.github.com/users/mwwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwwa/subscriptions","organizations_url":"https://api.github.com/users/mwwa/orgs","repos_url":"https://api.github.com/users/mwwa/repos","events_url":"https://api.github.com/users/mwwa/events{/privacy}","received_events_url":"https://api.github.com/users/mwwa/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/108/commits","review_comments_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/108/comments","review_comment_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/108/comments","statuses_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/statuses/4ac4f463d091830c2054f1bfea5125e2d9c64722","head":{"label":"dgrove-oss:data-destructor","ref":"data-destructor","sha":"4ac4f463d091830c2054f1bfea5125e2d9c64722","user":{"login":"dgrove-oss","id":5099100,"avatar_url":"https://avatars.githubusercontent.com/u/5099100?v=3","gravatar_id":"","url":"https://api.github.com/users/dgrove-oss","html_url":"https://github.com/dgrove-oss","followers_url":"https://api.github.com/users/dgrove-oss/followers","following_url":"https://api.github.com/users/dgrove-oss/following{/other_user}","gists_url":"https://api.github.com/users/dgrove-oss/gists{/gist_id}","starred_url":"https://api.github.com/users/dgrove-oss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgrove-oss/subscriptions","organizations_url":"https://api.github.com/users/dgrove-oss/orgs","repos_url":"https://api.github.com/users/dgrove-oss/repos","events_url":"https://api.github.com/users/dgrove-oss/events{/privacy}","received_events_url":"https://api.github.com/users/dgrove-oss/received_events","type":"User","site_admin":false},"repo":{"id":47428328,"name":"swift-corelibs-libdispatch","full_name":"dgrove-oss/swift-corelibs-libdispatch","owner":{"login":"dgrove-oss","id":5099100,"avatar_url":"https://avatars.githubusercontent.com/u/5099100?v=3","gravatar_id":"","url":"https://api.github.com/users/dgrove-oss","html_url":"https://github.com/dgrove-oss","followers_url":"https://api.github.com/users/dgrove-oss/followers","following_url":"https://api.github.com/users/dgrove-oss/following{/other_user}","gists_url":"https://api.github.com/users/dgrove-oss/gists{/gist_id}","starred_url":"https://api.github.com/users/dgrove-oss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgrove-oss/subscriptions","organizations_url":"https://api.github.com/users/dgrove-oss/orgs","repos_url":"https://api.github.com/users/dgrove-oss/repos","events_url":"https://api.github.com/users/dgrove-oss/events{/privacy}","received_events_url":"https://api.github.com/users/dgrove-oss/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dgrove-oss/swift-corelibs-libdispatch","description":"The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware","fork":true,"url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch","forks_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/forks","keys_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/teams","hooks_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/hooks","issue_events_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/issues/events{/number}","events_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/events","assignees_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/assignees{/user}","branches_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/branches{/branch}","tags_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/tags","blobs_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/statuses/{sha}","languages_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/languages","stargazers_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/stargazers","contributors_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/contributors","subscribers_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/subscribers","subscription_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/subscription","commits_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/contents/{+path}","compare_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/merges","archive_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/downloads","issues_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/issues{/number}","pulls_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/pulls{/number}","milestones_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/milestones{/number}","notifications_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/labels{/name}","releases_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/releases{/id}","deployments_url":"https://api.github.com/repos/dgrove-oss/swift-corelibs-libdispatch/deployments","created_at":"2015-12-04T20:54:44Z","updated_at":"2016-01-11T16:59:40Z","pushed_at":"2016-07-15T21:42:43Z","git_url":"git://github.com/dgrove-oss/swift-corelibs-libdispatch.git","ssh_url":"git@github.com:dgrove-oss/swift-corelibs-libdispatch.git","clone_url":"https://github.com/dgrove-oss/swift-corelibs-libdispatch.git","svn_url":"https://github.com/dgrove-oss/swift-corelibs-libdispatch","homepage":"swift.org","size":1192,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"apple:master","ref":"master","sha":"77299eceb0edebeca44b3a8d489e5c3f3471cdac","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":45863965,"name":"swift-corelibs-libdispatch","full_name":"apple/swift-corelibs-libdispatch","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-corelibs-libdispatch","description":"The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware","fork":false,"url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch","forks_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/forks","keys_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/teams","hooks_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/hooks","issue_events_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/events","assignees_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/tags","blobs_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/languages","stargazers_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/stargazers","contributors_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/contributors","subscribers_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/subscribers","subscription_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/subscription","commits_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/merges","archive_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/downloads","issues_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/deployments","created_at":"2015-11-09T20:13:55Z","updated_at":"2016-07-13T19:43:07Z","pushed_at":"2016-07-15T21:08:25Z","git_url":"git://github.com/apple/swift-corelibs-libdispatch.git","ssh_url":"git@github.com:apple/swift-corelibs-libdispatch.git","clone_url":"https://github.com/apple/swift-corelibs-libdispatch.git","svn_url":"https://github.com/apple/swift-corelibs-libdispatch","homepage":"swift.org","size":1348,"stargazers_count":729,"watchers_count":729,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":113,"mirror_url":null,"open_issues_count":3,"forks":113,"open_issues":3,"watchers":729,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/108"},"html":{"href":"https://github.com/apple/swift-corelibs-libdispatch/pull/108"},"issue":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/108"},"comments":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift-corelibs-libdispatch/statuses/4ac4f463d091830c2054f1bfea5125e2d9c64722"}}}}
{"actor":{"display_login":"dgrove-oss"}}