{"action":"created","comment":{"url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/comments/23899041","id":23899041,"diff_hunk":"@@ -2911,43 +2915,37 @@ struct LargeObjectPool\n      */\n     size_t allocPages(size_t n) nothrow\n     {\n-        if(freepages < n) return OPFAIL;\n-        size_t i;\n-        size_t n2;\n+        if(largestFree < n)\n+            return OPFAIL;\n \n         //debug(PRINTF) printf(\"Pool::allocPages(n = %d)\\n\", n);\n-        n2 = n;\n-        for (i = searchStart; i < npages; i++)\n+        size_t largest = 0;\n+        while (searchStart < npages && pagetable[searchStart] != B_FREE)\n+            searchStart++;","path":"src/gc/gc.d","position":40,"original_position":40,"commit_id":"4c26923fb3596ff9c4ba68422923ad709d8a252d","original_commit_id":"4c26923fb3596ff9c4ba68422923ad709d8a252d","user":{"login":"MartinNowak","id":288976,"avatar_url":"https://avatars.githubusercontent.com/u/288976?v=3","gravatar_id":"","url":"https://api.github.com/users/MartinNowak","html_url":"https://github.com/MartinNowak","followers_url":"https://api.github.com/users/MartinNowak/followers","following_url":"https://api.github.com/users/MartinNowak/following{/other_user}","gists_url":"https://api.github.com/users/MartinNowak/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinNowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinNowak/subscriptions","organizations_url":"https://api.github.com/users/MartinNowak/orgs","repos_url":"https://api.github.com/users/MartinNowak/repos","events_url":"https://api.github.com/users/MartinNowak/events{/privacy}","received_events_url":"https://api.github.com/users/MartinNowak/received_events","type":"User","site_admin":false},"body":"Can't you do the `== B_PAGE; searchStart += bPageOffsets[searchStart];` trick here too?","created_at":"2015-02-01T17:01:03Z","updated_at":"2015-02-01T17:01:03Z","html_url":"https://github.com/D-Programming-Language/druntime/pull/1149#discussion_r23899041","pull_request_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1149","_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/comments/23899041"},"html":{"href":"https://github.com/D-Programming-Language/druntime/pull/1149#discussion_r23899041"},"pull_request":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1149"}}},"pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1149","id":28433283,"html_url":"https://github.com/D-Programming-Language/druntime/pull/1149","diff_url":"https://github.com/D-Programming-Language/druntime/pull/1149.diff","patch_url":"https://github.com/D-Programming-Language/druntime/pull/1149.patch","issue_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/1149","number":1149,"state":"open","locked":false,"title":"GC: cache the largest free chunk of pages in LargeAllocPool","user":{"login":"rainers","id":702284,"avatar_url":"https://avatars.githubusercontent.com/u/702284?v=3","gravatar_id":"","url":"https://api.github.com/users/rainers","html_url":"https://github.com/rainers","followers_url":"https://api.github.com/users/rainers/followers","following_url":"https://api.github.com/users/rainers/following{/other_user}","gists_url":"https://api.github.com/users/rainers/gists{/gist_id}","starred_url":"https://api.github.com/users/rainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainers/subscriptions","organizations_url":"https://api.github.com/users/rainers/orgs","repos_url":"https://api.github.com/users/rainers/repos","events_url":"https://api.github.com/users/rainers/events{/privacy}","received_events_url":"https://api.github.com/users/rainers/received_events","type":"User","site_admin":false},"body":"also refactored LargeAllocPool.allocPages for better readibility and performance.\r\n\r\nThis dropped execution time of the rand_large benchmark from >3sec to 0.8 sec on Win32. It didn't have much influence on the other tests, though.","created_at":"2015-02-01T16:33:20Z","updated_at":"2015-02-01T17:01:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f073f700d2692c74316b8f428540e48a422fd56","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1149/commits","review_comments_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1149/comments","review_comment_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/comments/{number}","comments_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/1149/comments","statuses_url":"https://api.github.com/repos/D-Programming-Language/druntime/statuses/4c26923fb3596ff9c4ba68422923ad709d8a252d","head":{"label":"rainers:gc_opt_allocPages","ref":"gc_opt_allocPages","sha":"4c26923fb3596ff9c4ba68422923ad709d8a252d","user":{"login":"rainers","id":702284,"avatar_url":"https://avatars.githubusercontent.com/u/702284?v=3","gravatar_id":"","url":"https://api.github.com/users/rainers","html_url":"https://github.com/rainers","followers_url":"https://api.github.com/users/rainers/followers","following_url":"https://api.github.com/users/rainers/following{/other_user}","gists_url":"https://api.github.com/users/rainers/gists{/gist_id}","starred_url":"https://api.github.com/users/rainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainers/subscriptions","organizations_url":"https://api.github.com/users/rainers/orgs","repos_url":"https://api.github.com/users/rainers/repos","events_url":"https://api.github.com/users/rainers/events{/privacy}","received_events_url":"https://api.github.com/users/rainers/received_events","type":"User","site_admin":false},"repo":{"id":1625600,"name":"druntime","full_name":"rainers/druntime","owner":{"login":"rainers","id":702284,"avatar_url":"https://avatars.githubusercontent.com/u/702284?v=3","gravatar_id":"","url":"https://api.github.com/users/rainers","html_url":"https://github.com/rainers","followers_url":"https://api.github.com/users/rainers/followers","following_url":"https://api.github.com/users/rainers/following{/other_user}","gists_url":"https://api.github.com/users/rainers/gists{/gist_id}","starred_url":"https://api.github.com/users/rainers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainers/subscriptions","organizations_url":"https://api.github.com/users/rainers/orgs","repos_url":"https://api.github.com/users/rainers/repos","events_url":"https://api.github.com/users/rainers/events{/privacy}","received_events_url":"https://api.github.com/users/rainers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rainers/druntime","description":"Low level runtime library for the D programming language","fork":true,"url":"https://api.github.com/repos/rainers/druntime","forks_url":"https://api.github.com/repos/rainers/druntime/forks","keys_url":"https://api.github.com/repos/rainers/druntime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rainers/druntime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rainers/druntime/teams","hooks_url":"https://api.github.com/repos/rainers/druntime/hooks","issue_events_url":"https://api.github.com/repos/rainers/druntime/issues/events{/number}","events_url":"https://api.github.com/repos/rainers/druntime/events","assignees_url":"https://api.github.com/repos/rainers/druntime/assignees{/user}","branches_url":"https://api.github.com/repos/rainers/druntime/branches{/branch}","tags_url":"https://api.github.com/repos/rainers/druntime/tags","blobs_url":"https://api.github.com/repos/rainers/druntime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rainers/druntime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rainers/druntime/git/refs{/sha}","trees_url":"https://api.github.com/repos/rainers/druntime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rainers/druntime/statuses/{sha}","languages_url":"https://api.github.com/repos/rainers/druntime/languages","stargazers_url":"https://api.github.com/repos/rainers/druntime/stargazers","contributors_url":"https://api.github.com/repos/rainers/druntime/contributors","subscribers_url":"https://api.github.com/repos/rainers/druntime/subscribers","subscription_url":"https://api.github.com/repos/rainers/druntime/subscription","commits_url":"https://api.github.com/repos/rainers/druntime/commits{/sha}","git_commits_url":"https://api.github.com/repos/rainers/druntime/git/commits{/sha}","comments_url":"https://api.github.com/repos/rainers/druntime/comments{/number}","issue_comment_url":"https://api.github.com/repos/rainers/druntime/issues/comments/{number}","contents_url":"https://api.github.com/repos/rainers/druntime/contents/{+path}","compare_url":"https://api.github.com/repos/rainers/druntime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rainers/druntime/merges","archive_url":"https://api.github.com/repos/rainers/druntime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rainers/druntime/downloads","issues_url":"https://api.github.com/repos/rainers/druntime/issues{/number}","pulls_url":"https://api.github.com/repos/rainers/druntime/pulls{/number}","milestones_url":"https://api.github.com/repos/rainers/druntime/milestones{/number}","notifications_url":"https://api.github.com/repos/rainers/druntime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rainers/druntime/labels{/name}","releases_url":"https://api.github.com/repos/rainers/druntime/releases{/id}","created_at":"2011-04-17T07:30:25Z","updated_at":"2014-06-14T15:40:00Z","pushed_at":"2015-02-01T16:30:15Z","git_url":"git://github.com/rainers/druntime.git","ssh_url":"git@github.com:rainers/druntime.git","clone_url":"https://github.com/rainers/druntime.git","svn_url":"https://github.com/rainers/druntime","homepage":"d-programming-language.org","size":9896,"stargazers_count":4,"watchers_count":4,"language":"D","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":4,"default_branch":"master"}},"base":{"label":"D-Programming-Language:master","ref":"master","sha":"39bfc5de6764734595ef59fe21b202ea4b52341a","user":{"login":"D-Programming-Language","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Programming-Language","html_url":"https://github.com/D-Programming-Language","followers_url":"https://api.github.com/users/D-Programming-Language/followers","following_url":"https://api.github.com/users/D-Programming-Language/following{/other_user}","gists_url":"https://api.github.com/users/D-Programming-Language/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Programming-Language/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Programming-Language/subscriptions","organizations_url":"https://api.github.com/users/D-Programming-Language/orgs","repos_url":"https://api.github.com/users/D-Programming-Language/repos","events_url":"https://api.github.com/users/D-Programming-Language/events{/privacy}","received_events_url":"https://api.github.com/users/D-Programming-Language/received_events","type":"Organization","site_admin":false},"repo":{"id":1257087,"name":"druntime","full_name":"D-Programming-Language/druntime","owner":{"login":"D-Programming-Language","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Programming-Language","html_url":"https://github.com/D-Programming-Language","followers_url":"https://api.github.com/users/D-Programming-Language/followers","following_url":"https://api.github.com/users/D-Programming-Language/following{/other_user}","gists_url":"https://api.github.com/users/D-Programming-Language/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Programming-Language/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Programming-Language/subscriptions","organizations_url":"https://api.github.com/users/D-Programming-Language/orgs","repos_url":"https://api.github.com/users/D-Programming-Language/repos","events_url":"https://api.github.com/users/D-Programming-Language/events{/privacy}","received_events_url":"https://api.github.com/users/D-Programming-Language/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/D-Programming-Language/druntime","description":"Low level runtime library for the D programming language","fork":false,"url":"https://api.github.com/repos/D-Programming-Language/druntime","forks_url":"https://api.github.com/repos/D-Programming-Language/druntime/forks","keys_url":"https://api.github.com/repos/D-Programming-Language/druntime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/D-Programming-Language/druntime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/D-Programming-Language/druntime/teams","hooks_url":"https://api.github.com/repos/D-Programming-Language/druntime/hooks","issue_events_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/events{/number}","events_url":"https://api.github.com/repos/D-Programming-Language/druntime/events","assignees_url":"https://api.github.com/repos/D-Programming-Language/druntime/assignees{/user}","branches_url":"https://api.github.com/repos/D-Programming-Language/druntime/branches{/branch}","tags_url":"https://api.github.com/repos/D-Programming-Language/druntime/tags","blobs_url":"https://api.github.com/repos/D-Programming-Language/druntime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/D-Programming-Language/druntime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/D-Programming-Language/druntime/git/refs{/sha}","trees_url":"https://api.github.com/repos/D-Programming-Language/druntime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/D-Programming-Language/druntime/statuses/{sha}","languages_url":"https://api.github.com/repos/D-Programming-Language/druntime/languages","stargazers_url":"https://api.github.com/repos/D-Programming-Language/druntime/stargazers","contributors_url":"https://api.github.com/repos/D-Programming-Language/druntime/contributors","subscribers_url":"https://api.github.com/repos/D-Programming-Language/druntime/subscribers","subscription_url":"https://api.github.com/repos/D-Programming-Language/druntime/subscription","commits_url":"https://api.github.com/repos/D-Programming-Language/druntime/commits{/sha}","git_commits_url":"https://api.github.com/repos/D-Programming-Language/druntime/git/commits{/sha}","comments_url":"https://api.github.com/repos/D-Programming-Language/druntime/comments{/number}","issue_comment_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/comments/{number}","contents_url":"https://api.github.com/repos/D-Programming-Language/druntime/contents/{+path}","compare_url":"https://api.github.com/repos/D-Programming-Language/druntime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/D-Programming-Language/druntime/merges","archive_url":"https://api.github.com/repos/D-Programming-Language/druntime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/D-Programming-Language/druntime/downloads","issues_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues{/number}","pulls_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls{/number}","milestones_url":"https://api.github.com/repos/D-Programming-Language/druntime/milestones{/number}","notifications_url":"https://api.github.com/repos/D-Programming-Language/druntime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/D-Programming-Language/druntime/labels{/name}","releases_url":"https://api.github.com/repos/D-Programming-Language/druntime/releases{/id}","created_at":"2011-01-15T07:01:38Z","updated_at":"2015-02-01T16:59:55Z","pushed_at":"2015-02-01T16:59:55Z","git_url":"git://github.com/D-Programming-Language/druntime.git","ssh_url":"git@github.com:D-Programming-Language/druntime.git","clone_url":"https://github.com/D-Programming-Language/druntime.git","svn_url":"https://github.com/D-Programming-Language/druntime","homepage":"dlang.org","size":16063,"stargazers_count":344,"watchers_count":344,"language":"D","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":224,"mirror_url":null,"open_issues_count":31,"forks":224,"open_issues":31,"watchers":344,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1149"},"html":{"href":"https://github.com/D-Programming-Language/druntime/pull/1149"},"issue":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/issues/1149"},"comments":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/issues/1149/comments"},"review_comments":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1149/comments"},"review_comment":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1149/commits"},"statuses":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/statuses/4c26923fb3596ff9c4ba68422923ad709d8a252d"}}}}