{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/136380115","pull_request_review_id":59911831,"id":136380115,"diff_hunk":"@@ -117,5 +117,86 @@ public static class SpanExtensions\n         \n         public static ReadOnlySpan<TTo> NonPortableCast<TFrom, TTo>(this ReadOnlySpan<TFrom> source) where TFrom : struct where TTo : struct { throw null; }\n     }\n+\n+    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]\n+    public struct ReadOnlyMemory<T>\n+    {\n+        public static ReadOnlyMemory<T> Empty { get { throw null; } }\n+        public ReadOnlyMemory(T[] array) { throw null;}\n+        public ReadOnlyMemory(T[] array, int start, int length) { throw null;}\n+        internal ReadOnlyMemory(Buffers.OwnedMemory<T> owner, int index, int length) { throw null;}\n+        public bool IsEmpty { get { throw null; } }\n+        public int Length { get { throw null; } }\n+        [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n+        public override bool Equals(object obj) { throw null; }\n+        public bool Equals(ReadOnlyMemory<T> other) { throw null; }\n+        [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]\n+        public override int GetHashCode() { throw null; }\n+        public static implicit operator ReadOnlyMemory<T>(T[] array) { throw null; }\n+        public static implicit operator ReadOnlyMemory<T>(ArraySegment<T> arraySegment) { throw null; }\n+        public ReadOnlyMemory<T> Slice(int start) { throw null; }\n+        public ReadOnlyMemory<T> Slice(int start, int length) { throw null; }\n+        public ReadOnlySpan<T> Span { get { throw null; } }","path":"src/System.Memory/ref/System.Memory.cs","position":23,"original_position":23,"commit_id":"5b9c44cf94408e9a9814a20d017d995a7d6a1f46","original_commit_id":"2b059b12d4a3d8c167f3db718c0b1d75bd9bc6f7","user":{"login":"KrzysztofCwalina","id":9724236,"avatar_url":"https://avatars0.githubusercontent.com/u/9724236?v=4","gravatar_id":"","url":"https://api.github.com/users/KrzysztofCwalina","html_url":"https://github.com/KrzysztofCwalina","followers_url":"https://api.github.com/users/KrzysztofCwalina/followers","following_url":"https://api.github.com/users/KrzysztofCwalina/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofCwalina/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofCwalina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofCwalina/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofCwalina/orgs","repos_url":"https://api.github.com/users/KrzysztofCwalina/repos","events_url":"https://api.github.com/users/KrzysztofCwalina/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofCwalina/received_events","type":"User","site_admin":false},"body":"I have to say I am not a big fan of this whole AsReadOnlyXxx naming pattern. I would prefer all APIs to get spans or memory to be simple/same property/method and the return type being the right type (read-only or r/w) depending on the source. Otherwise it's more difficult to move code from r/w to r/o, and the caller has to continuesly remember which variables are r/o vs r/w","created_at":"2017-08-31T16:13:20Z","updated_at":"2017-08-31T16:13:20Z","html_url":"https://github.com/dotnet/corefx/pull/23701#discussion_r136380115","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/23701","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/136380115"},"html":{"href":"https://github.com/dotnet/corefx/pull/23701#discussion_r136380115"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/23701"}},"in_reply_to_id":136247265},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/23701","id":138582041,"html_url":"https://github.com/dotnet/corefx/pull/23701","diff_url":"https://github.com/dotnet/corefx/pull/23701.diff","patch_url":"https://github.com/dotnet/corefx/pull/23701.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/23701","number":23701,"state":"open","locked":false,"title":"[WIP] Adding Memory, OwnedMemory, MemoryHandle, and IRetainable","user":{"login":"ahsonkhan","id":6527137,"avatar_url":"https://avatars1.githubusercontent.com/u/6527137?v=4","gravatar_id":"","url":"https://api.github.com/users/ahsonkhan","html_url":"https://github.com/ahsonkhan","followers_url":"https://api.github.com/users/ahsonkhan/followers","following_url":"https://api.github.com/users/ahsonkhan/following{/other_user}","gists_url":"https://api.github.com/users/ahsonkhan/gists{/gist_id}","starred_url":"https://api.github.com/users/ahsonkhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahsonkhan/subscriptions","organizations_url":"https://api.github.com/users/ahsonkhan/orgs","repos_url":"https://api.github.com/users/ahsonkhan/repos","events_url":"https://api.github.com/users/ahsonkhan/events{/privacy}","received_events_url":"https://api.github.com/users/ahsonkhan/received_events","type":"User","site_admin":false},"body":"The CI will be green after the corresponding PR in coreclr gets merged: https://github.com/dotnet/coreclr/pull/13583\r\n\r\n**In Progress:** Working on adding tests (including those from corefxlab - https://github.com/dotnet/corefxlab/tree/master/tests/System.Buffers.Primitives.Tests).\r\n\r\nPart of https://github.com/dotnet/corefxlab/issues/1711\r\n\r\nAdding the following types:\r\n- Memory\\<T\\>\r\n- ReadOnlyMemory\\<T\\>\r\n- OwnedMemory\\<T\\>\r\n- MemoryHandle\r\n- IRetainable\r\n\r\nOrder of changes:\r\n1) Add to mscorlib (https://github.com/dotnet/coreclr/pull/13583).\r\n2) After the type has been added to mscorlib, add impl (for portable) and type forwarders to System.Memory (this PR) and System.Runtime here in corefx.\r\n3) Remove impl from corefxlab and update uses/references in Pipelines/Buffers.Experimental.\r\n4) Other changes/additions like review/add APIs from MemoryExtensions\r\n\r\ncc @shiftylogic, @KrzysztofCwalina, @davidfowl, @jkotas, @stephentoub, @AtsushiKan ","created_at":"2017-08-31T05:14:09Z","updated_at":"2017-08-31T16:13:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6cffa022fb8947d55fd4af9365b8081ffbbf89b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars0.githubusercontent.com/u/2642209?v=4","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},{"login":"KrzysztofCwalina","id":9724236,"avatar_url":"https://avatars0.githubusercontent.com/u/9724236?v=4","gravatar_id":"","url":"https://api.github.com/users/KrzysztofCwalina","html_url":"https://github.com/KrzysztofCwalina","followers_url":"https://api.github.com/users/KrzysztofCwalina/followers","following_url":"https://api.github.com/users/KrzysztofCwalina/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofCwalina/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofCwalina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofCwalina/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofCwalina/orgs","repos_url":"https://api.github.com/users/KrzysztofCwalina/repos","events_url":"https://api.github.com/users/KrzysztofCwalina/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofCwalina/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/23701/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/23701/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/23701/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/5b9c44cf94408e9a9814a20d017d995a7d6a1f46","head":{"label":"ahsonkhan:AddMemoryofT","ref":"AddMemoryofT","sha":"5b9c44cf94408e9a9814a20d017d995a7d6a1f46","user":{"login":"ahsonkhan","id":6527137,"avatar_url":"https://avatars1.githubusercontent.com/u/6527137?v=4","gravatar_id":"","url":"https://api.github.com/users/ahsonkhan","html_url":"https://github.com/ahsonkhan","followers_url":"https://api.github.com/users/ahsonkhan/followers","following_url":"https://api.github.com/users/ahsonkhan/following{/other_user}","gists_url":"https://api.github.com/users/ahsonkhan/gists{/gist_id}","starred_url":"https://api.github.com/users/ahsonkhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahsonkhan/subscriptions","organizations_url":"https://api.github.com/users/ahsonkhan/orgs","repos_url":"https://api.github.com/users/ahsonkhan/repos","events_url":"https://api.github.com/users/ahsonkhan/events{/privacy}","received_events_url":"https://api.github.com/users/ahsonkhan/received_events","type":"User","site_admin":false},"repo":{"id":75784851,"name":"corefx","full_name":"ahsonkhan/corefx","owner":{"login":"ahsonkhan","id":6527137,"avatar_url":"https://avatars1.githubusercontent.com/u/6527137?v=4","gravatar_id":"","url":"https://api.github.com/users/ahsonkhan","html_url":"https://github.com/ahsonkhan","followers_url":"https://api.github.com/users/ahsonkhan/followers","following_url":"https://api.github.com/users/ahsonkhan/following{/other_user}","gists_url":"https://api.github.com/users/ahsonkhan/gists{/gist_id}","starred_url":"https://api.github.com/users/ahsonkhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahsonkhan/subscriptions","organizations_url":"https://api.github.com/users/ahsonkhan/orgs","repos_url":"https://api.github.com/users/ahsonkhan/repos","events_url":"https://api.github.com/users/ahsonkhan/events{/privacy}","received_events_url":"https://api.github.com/users/ahsonkhan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ahsonkhan/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":true,"url":"https://api.github.com/repos/ahsonkhan/corefx","forks_url":"https://api.github.com/repos/ahsonkhan/corefx/forks","keys_url":"https://api.github.com/repos/ahsonkhan/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ahsonkhan/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ahsonkhan/corefx/teams","hooks_url":"https://api.github.com/repos/ahsonkhan/corefx/hooks","issue_events_url":"https://api.github.com/repos/ahsonkhan/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/ahsonkhan/corefx/events","assignees_url":"https://api.github.com/repos/ahsonkhan/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/ahsonkhan/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/ahsonkhan/corefx/tags","blobs_url":"https://api.github.com/repos/ahsonkhan/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ahsonkhan/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ahsonkhan/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/ahsonkhan/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ahsonkhan/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/ahsonkhan/corefx/languages","stargazers_url":"https://api.github.com/repos/ahsonkhan/corefx/stargazers","contributors_url":"https://api.github.com/repos/ahsonkhan/corefx/contributors","subscribers_url":"https://api.github.com/repos/ahsonkhan/corefx/subscribers","subscription_url":"https://api.github.com/repos/ahsonkhan/corefx/subscription","commits_url":"https://api.github.com/repos/ahsonkhan/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/ahsonkhan/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/ahsonkhan/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/ahsonkhan/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/ahsonkhan/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/ahsonkhan/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ahsonkhan/corefx/merges","archive_url":"https://api.github.com/repos/ahsonkhan/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ahsonkhan/corefx/downloads","issues_url":"https://api.github.com/repos/ahsonkhan/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/ahsonkhan/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/ahsonkhan/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/ahsonkhan/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ahsonkhan/corefx/labels{/name}","releases_url":"https://api.github.com/repos/ahsonkhan/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/ahsonkhan/corefx/deployments","created_at":"2016-12-07T00:49:36Z","updated_at":"2016-12-07T00:50:05Z","pushed_at":"2017-08-31T05:30:40Z","git_url":"git://github.com/ahsonkhan/corefx.git","ssh_url":"git@github.com:ahsonkhan/corefx.git","clone_url":"https://github.com/ahsonkhan/corefx.git","svn_url":"https://github.com/ahsonkhan/corefx","homepage":"https://docs.microsoft.com/dotnet/","size":154100,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"dotnet:master","ref":"master","sha":"e3b2c5491ac38efdfec5f017f72223b7d8c10f5d","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2017-08-31T15:22:49Z","pushed_at":"2017-08-31T14:39:53Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"https://github.com/dotnet/core","size":155400,"stargazers_count":12422,"watchers_count":12422,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3433,"mirror_url":null,"open_issues_count":1925,"forks":3433,"open_issues":1925,"watchers":12422,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/23701"},"html":{"href":"https://github.com/dotnet/corefx/pull/23701"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/23701"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/23701/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/23701/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/23701/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/5b9c44cf94408e9a9814a20d017d995a7d6a1f46"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"KrzysztofCwalina"}}