{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/110338422","pull_request_review_id":31504537,"id":110338422,"diff_hunk":"@@ -909,73 +909,141 @@ PTR_PEImageLayout PEImage::GetLayoutInternal(DWORD imageLayoutMask,DWORD flags)\n     {\n         _ASSERTE(HasID());\n \n-        if (imageLayoutMask&PEImageLayout::LAYOUT_MAPPED)\n-        {\n-            PEImageLayout * pLoadLayout = NULL;\n+        BOOL bIsMappedLayoutSuitable = ((imageLayoutMask & PEImageLayout::LAYOUT_MAPPED) != 0);\n+        BOOL bIsFlatLayoutSuitable = ((imageLayoutMask & PEImageLayout::LAYOUT_FLAT) != 0);\n \n-            if (m_bIsTrustedNativeImage || IsFile())\n-            {\n-                // For CoreCLR, try to load all files via LoadLibrary first. If LoadLibrary did not work, retry using \n-                // regular mapping - but not for native images.\n-                pLoadLayout = PEImageLayout::Load(this, TRUE /* bNTSafeLoad */, m_bIsTrustedNativeImage /* bThrowOnError */);","path":"src/vm/peimage.cpp","position":14,"original_position":14,"commit_id":"01f0f5a41aa4e5d4d046b9760968fe5e64622951","original_commit_id":"01f0f5a41aa4e5d4d046b9760968fe5e64622951","user":{"login":"ruben-ayrapetyan","id":11939769,"avatar_url":"https://avatars2.githubusercontent.com/u/11939769?v=3","gravatar_id":"","url":"https://api.github.com/users/ruben-ayrapetyan","html_url":"https://github.com/ruben-ayrapetyan","followers_url":"https://api.github.com/users/ruben-ayrapetyan/followers","following_url":"https://api.github.com/users/ruben-ayrapetyan/following{/other_user}","gists_url":"https://api.github.com/users/ruben-ayrapetyan/gists{/gist_id}","starred_url":"https://api.github.com/users/ruben-ayrapetyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruben-ayrapetyan/subscriptions","organizations_url":"https://api.github.com/users/ruben-ayrapetyan/orgs","repos_url":"https://api.github.com/users/ruben-ayrapetyan/repos","events_url":"https://api.github.com/users/ruben-ayrapetyan/events{/privacy}","received_events_url":"https://api.github.com/users/ruben-ayrapetyan/received_events","type":"User","site_admin":false},"body":"@jkotas, \r\nThis part of code was extracted to `PTR_PEImageLayout PEImage::CreateLayoutMapped` as is, and so wasn't changed.\r\nOnly the priority of trying `Flat` and `Mapped` layouts was changed here.","created_at":"2017-04-07T08:16:15Z","updated_at":"2017-04-07T08:16:15Z","html_url":"https://github.com/dotnet/coreclr/pull/10772#discussion_r110338422","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/10772","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/110338422"},"html":{"href":"https://github.com/dotnet/coreclr/pull/10772#discussion_r110338422"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/10772"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/10772","id":114683394,"html_url":"https://github.com/dotnet/coreclr/pull/10772","diff_url":"https://github.com/dotnet/coreclr/pull/10772.diff","patch_url":"https://github.com/dotnet/coreclr/pull/10772.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/10772","number":10772,"state":"open","locked":false,"title":"Direct-mapping of IL-assembly images without writeable sections","user":{"login":"ruben-ayrapetyan","id":11939769,"avatar_url":"https://avatars2.githubusercontent.com/u/11939769?v=3","gravatar_id":"","url":"https://api.github.com/users/ruben-ayrapetyan","html_url":"https://github.com/ruben-ayrapetyan","followers_url":"https://api.github.com/users/ruben-ayrapetyan/followers","following_url":"https://api.github.com/users/ruben-ayrapetyan/following{/other_user}","gists_url":"https://api.github.com/users/ruben-ayrapetyan/gists{/gist_id}","starred_url":"https://api.github.com/users/ruben-ayrapetyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruben-ayrapetyan/subscriptions","organizations_url":"https://api.github.com/users/ruben-ayrapetyan/orgs","repos_url":"https://api.github.com/users/ruben-ayrapetyan/repos","events_url":"https://api.github.com/users/ruben-ayrapetyan/events{/privacy}","received_events_url":"https://api.github.com/users/ruben-ayrapetyan/received_events","type":"User","site_admin":false},"body":"Before the changes:\r\n\r\n- If file alignment sections of IL-only assemblies is less than size of virtual page, then the pages are not directly mapped to memory, but instead are copied to anonymous memory.\r\n\r\nWith the changes:\r\n\r\n- IL-only assemblies without writeable sections are directly mapped to memory in flat mode (i.e. without separate maps per section).\r\n\r\nThis means that physical memory for the assemblies is allocated only once with the changes, even if the assemblies are loaded into multiple processes, so memory consumption reduces.\r\n\r\nRelated issue: #10693 \r\n\r\nTesting: in process (status will be updated)","created_at":"2017-04-06T20:04:55Z","updated_at":"2017-04-07T08:16:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c843c6379f5b9f7a741ebd8fe252a7cc2d7e990","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/10772/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/10772/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/10772/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/01f0f5a41aa4e5d4d046b9760968fe5e64622951","head":{"label":"ruben-ayrapetyan:share-il-only-assemblies","ref":"share-il-only-assemblies","sha":"01f0f5a41aa4e5d4d046b9760968fe5e64622951","user":{"login":"ruben-ayrapetyan","id":11939769,"avatar_url":"https://avatars2.githubusercontent.com/u/11939769?v=3","gravatar_id":"","url":"https://api.github.com/users/ruben-ayrapetyan","html_url":"https://github.com/ruben-ayrapetyan","followers_url":"https://api.github.com/users/ruben-ayrapetyan/followers","following_url":"https://api.github.com/users/ruben-ayrapetyan/following{/other_user}","gists_url":"https://api.github.com/users/ruben-ayrapetyan/gists{/gist_id}","starred_url":"https://api.github.com/users/ruben-ayrapetyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruben-ayrapetyan/subscriptions","organizations_url":"https://api.github.com/users/ruben-ayrapetyan/orgs","repos_url":"https://api.github.com/users/ruben-ayrapetyan/repos","events_url":"https://api.github.com/users/ruben-ayrapetyan/events{/privacy}","received_events_url":"https://api.github.com/users/ruben-ayrapetyan/received_events","type":"User","site_admin":false},"repo":{"id":86460916,"name":"coreclr","full_name":"ruben-ayrapetyan/coreclr","owner":{"login":"ruben-ayrapetyan","id":11939769,"avatar_url":"https://avatars2.githubusercontent.com/u/11939769?v=3","gravatar_id":"","url":"https://api.github.com/users/ruben-ayrapetyan","html_url":"https://github.com/ruben-ayrapetyan","followers_url":"https://api.github.com/users/ruben-ayrapetyan/followers","following_url":"https://api.github.com/users/ruben-ayrapetyan/following{/other_user}","gists_url":"https://api.github.com/users/ruben-ayrapetyan/gists{/gist_id}","starred_url":"https://api.github.com/users/ruben-ayrapetyan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruben-ayrapetyan/subscriptions","organizations_url":"https://api.github.com/users/ruben-ayrapetyan/orgs","repos_url":"https://api.github.com/users/ruben-ayrapetyan/repos","events_url":"https://api.github.com/users/ruben-ayrapetyan/events{/privacy}","received_events_url":"https://api.github.com/users/ruben-ayrapetyan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ruben-ayrapetyan/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":true,"url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr","forks_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/forks","keys_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/teams","hooks_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/hooks","issue_events_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/events","assignees_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/tags","blobs_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/languages","stargazers_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/stargazers","contributors_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/contributors","subscribers_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/subscribers","subscription_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/subscription","commits_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/merges","archive_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/downloads","issues_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/ruben-ayrapetyan/coreclr/deployments","created_at":"2017-03-28T13:04:20Z","updated_at":"2017-03-28T13:05:34Z","pushed_at":"2017-04-05T19:28:20Z","git_url":"git://github.com/ruben-ayrapetyan/coreclr.git","ssh_url":"git@github.com:ruben-ayrapetyan/coreclr.git","clone_url":"https://github.com/ruben-ayrapetyan/coreclr.git","svn_url":"https://github.com/ruben-ayrapetyan/coreclr","homepage":"https://docs.microsoft.com/dotnet/","size":149627,"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":"dd9307c8da599704271512476fc0e876cb071505","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars3.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://avatars3.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":"2017-04-06T19:13:36Z","pushed_at":"2017-04-07T07:56:50Z","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":150216,"stargazers_count":7609,"watchers_count":7609,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1897,"mirror_url":null,"open_issues_count":1209,"forks":1897,"open_issues":1209,"watchers":7609,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/10772"},"html":{"href":"https://github.com/dotnet/coreclr/pull/10772"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/10772"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/10772/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/10772/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/10772/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/01f0f5a41aa4e5d4d046b9760968fe5e64622951"}}}}
{"actor":{"display_login":"ruben-ayrapetyan"}}