{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/81396918","pull_request_review_id":2381936,"id":81396918,"diff_hunk":"@@ -404,27 +405,34 @@ protected override void Dispose(bool disposing)\n \n             int nInt = (int) n; // Safe because n <= count, which is an Int32\n             if (nInt < 0)\n-                nInt = 0;  // _position could be beyond EOF\n+                return 0;  // _position could be beyond EOF\n             Contract.Assert(pos + nInt >= 0, \"_position + n >= 0\");  // len is less than 2^63 -1.\n \n-            if (_buffer != null) {\n-                unsafe {\n-                    byte* pointer = null;\n-                    RuntimeHelpers.PrepareConstrainedRegions();\n-                    try {\n-                        _buffer.AcquirePointer(ref pointer);\n-                        Buffer.Memcpy(buffer, offset, pointer + pos + _offset, 0, nInt);\n-                    }\n-                    finally {\n-                        if (pointer != null) {\n-                            _buffer.ReleasePointer();\n+            unsafe\n+            {\n+                fixed (byte* pBuffer = buffer)\n+                {\n+                    if (_buffer != null)\n+                    {\n+                        byte* pointer = null;\n+\n+                        try\n+                        {\n+                            _buffer.AcquirePointer(ref pointer);\n+                            Buffer.MemoryCopy(source: pointer + pos + _offset, destination: pBuffer + offset, destinationSizeInBytes: nInt, sourceBytesToCopy: nInt);","path":"src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs","position":70,"original_position":70,"commit_id":"74179e3829664f83cf8d3ea4fc646b0ee57c4395","original_commit_id":"74179e3829664f83cf8d3ea4fc646b0ee57c4395","user":{"login":"alexperovich","id":10565410,"avatar_url":"https://avatars.githubusercontent.com/u/10565410?v=3","gravatar_id":"","url":"https://api.github.com/users/alexperovich","html_url":"https://github.com/alexperovich","followers_url":"https://api.github.com/users/alexperovich/followers","following_url":"https://api.github.com/users/alexperovich/following{/other_user}","gists_url":"https://api.github.com/users/alexperovich/gists{/gist_id}","starred_url":"https://api.github.com/users/alexperovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexperovich/subscriptions","organizations_url":"https://api.github.com/users/alexperovich/orgs","repos_url":"https://api.github.com/users/alexperovich/repos","events_url":"https://api.github.com/users/alexperovich/events{/privacy}","received_events_url":"https://api.github.com/users/alexperovich/received_events","type":"User","site_admin":false},"body":"Ill change it back.","created_at":"2016-09-30T18:49:06Z","updated_at":"2016-09-30T18:49:06Z","html_url":"https://github.com/dotnet/coreclr/pull/7418#discussion_r81396918","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/7418","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/81396918"},"html":{"href":"https://github.com/dotnet/coreclr/pull/7418#discussion_r81396918"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/7418"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/7418","id":87399685,"html_url":"https://github.com/dotnet/coreclr/pull/7418","diff_url":"https://github.com/dotnet/coreclr/pull/7418.diff","patch_url":"https://github.com/dotnet/coreclr/pull/7418.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/7418","number":7418,"state":"open","locked":false,"title":"Port changes to UnmanagedMemoryStream from corefx","user":{"login":"alexperovich","id":10565410,"avatar_url":"https://avatars.githubusercontent.com/u/10565410?v=3","gravatar_id":"","url":"https://api.github.com/users/alexperovich","html_url":"https://github.com/alexperovich","followers_url":"https://api.github.com/users/alexperovich/followers","following_url":"https://api.github.com/users/alexperovich/following{/other_user}","gists_url":"https://api.github.com/users/alexperovich/gists{/gist_id}","starred_url":"https://api.github.com/users/alexperovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexperovich/subscriptions","organizations_url":"https://api.github.com/users/alexperovich/orgs","repos_url":"https://api.github.com/users/alexperovich/repos","events_url":"https://api.github.com/users/alexperovich/events{/privacy}","received_events_url":"https://api.github.com/users/alexperovich/received_events","type":"User","site_admin":false},"body":"See dotnet/corefx#12170","created_at":"2016-09-29T21:43:16Z","updated_at":"2016-09-30T18:49:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e90a1a8f49d0ec38072fe3b8e2501fa93f2cc514","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/7418/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/7418/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/7418/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/74179e3829664f83cf8d3ea4fc646b0ee57c4395","head":{"label":"alexperovich:resources","ref":"resources","sha":"74179e3829664f83cf8d3ea4fc646b0ee57c4395","user":{"login":"alexperovich","id":10565410,"avatar_url":"https://avatars.githubusercontent.com/u/10565410?v=3","gravatar_id":"","url":"https://api.github.com/users/alexperovich","html_url":"https://github.com/alexperovich","followers_url":"https://api.github.com/users/alexperovich/followers","following_url":"https://api.github.com/users/alexperovich/following{/other_user}","gists_url":"https://api.github.com/users/alexperovich/gists{/gist_id}","starred_url":"https://api.github.com/users/alexperovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexperovich/subscriptions","organizations_url":"https://api.github.com/users/alexperovich/orgs","repos_url":"https://api.github.com/users/alexperovich/repos","events_url":"https://api.github.com/users/alexperovich/events{/privacy}","received_events_url":"https://api.github.com/users/alexperovich/received_events","type":"User","site_admin":false},"repo":{"id":30258654,"name":"coreclr","full_name":"alexperovich/coreclr","owner":{"login":"alexperovich","id":10565410,"avatar_url":"https://avatars.githubusercontent.com/u/10565410?v=3","gravatar_id":"","url":"https://api.github.com/users/alexperovich","html_url":"https://github.com/alexperovich","followers_url":"https://api.github.com/users/alexperovich/followers","following_url":"https://api.github.com/users/alexperovich/following{/other_user}","gists_url":"https://api.github.com/users/alexperovich/gists{/gist_id}","starred_url":"https://api.github.com/users/alexperovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexperovich/subscriptions","organizations_url":"https://api.github.com/users/alexperovich/orgs","repos_url":"https://api.github.com/users/alexperovich/repos","events_url":"https://api.github.com/users/alexperovich/events{/privacy}","received_events_url":"https://api.github.com/users/alexperovich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexperovich/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR. It is an execution engine for .NET apps, performing functions such as IL byte code loading, compilation to machine code and garbage collection. The repo contains the complete up-to-date CoreCLR codebase.","fork":true,"url":"https://api.github.com/repos/alexperovich/coreclr","forks_url":"https://api.github.com/repos/alexperovich/coreclr/forks","keys_url":"https://api.github.com/repos/alexperovich/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexperovich/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexperovich/coreclr/teams","hooks_url":"https://api.github.com/repos/alexperovich/coreclr/hooks","issue_events_url":"https://api.github.com/repos/alexperovich/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/alexperovich/coreclr/events","assignees_url":"https://api.github.com/repos/alexperovich/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/alexperovich/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/alexperovich/coreclr/tags","blobs_url":"https://api.github.com/repos/alexperovich/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexperovich/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexperovich/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexperovich/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexperovich/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/alexperovich/coreclr/languages","stargazers_url":"https://api.github.com/repos/alexperovich/coreclr/stargazers","contributors_url":"https://api.github.com/repos/alexperovich/coreclr/contributors","subscribers_url":"https://api.github.com/repos/alexperovich/coreclr/subscribers","subscription_url":"https://api.github.com/repos/alexperovich/coreclr/subscription","commits_url":"https://api.github.com/repos/alexperovich/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexperovich/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexperovich/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexperovich/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexperovich/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/alexperovich/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexperovich/coreclr/merges","archive_url":"https://api.github.com/repos/alexperovich/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexperovich/coreclr/downloads","issues_url":"https://api.github.com/repos/alexperovich/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/alexperovich/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/alexperovich/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/alexperovich/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexperovich/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/alexperovich/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/alexperovich/coreclr/deployments","created_at":"2015-02-03T18:47:09Z","updated_at":"2016-09-22T23:44:19Z","pushed_at":"2016-09-29T21:41:10Z","git_url":"git://github.com/alexperovich/coreclr.git","ssh_url":"git@github.com:alexperovich/coreclr.git","clone_url":"https://github.com/alexperovich/coreclr.git","svn_url":"https://github.com/alexperovich/coreclr","homepage":"","size":109422,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"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":"f93e169d61aec19ad2c0bd7630d4df4a1b9e4d24","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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":30092893,"name":"coreclr","full_name":"dotnet/coreclr","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2016-09-30T17:11:13Z","pushed_at":"2016-09-30T18:47:00Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"https://docs.microsoft.com/dotnet/","size":124174,"stargazers_count":6933,"watchers_count":6933,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1673,"mirror_url":null,"open_issues_count":996,"forks":1673,"open_issues":996,"watchers":6933,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/7418"},"html":{"href":"https://github.com/dotnet/coreclr/pull/7418"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/7418"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/7418/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/7418/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/7418/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/74179e3829664f83cf8d3ea4fc646b0ee57c4395"}}}}
{"actor":{"display_login":"alexperovich"}}