{"action":"created","comment":{"url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/comments/55972663","id":55972663,"diff_hunk":"@@ -0,0 +1,79 @@\n+#include \"mallocator.hpp\"\n+\n+#include <bolgenos-ng/stdtypes.hpp>\n+\n+#include <bolgenos-ng/error.h>\n+\n+\n+\n+#include <bolgenos-ng/cout.hpp>\n+\n+namespace {\n+\n+size_t chain_unit_size(size_t index) {\n+\tif (index == 0)\n+\t\treturn 8;\n+\treturn index * 16;\n+}\n+\n+} // namespace\n+\n+void memory::allocators::Mallocator::initialize(\n+\t\tmemory::allocators::PageAllocator *fallback,\n+\t\tsize_t chain_memory, size_t chain_length) {\n+\tfallback_ = fallback;\n+\tchain_length_ = chain_length;\n+\tconst size_t chain_size = sizeof(SlabAllocator)*chain_length;\n+\tif (! internal_allocator_.initialize(chain_size, 1)) {","path":"kernel/mallocator.cpp","position":27,"original_position":27,"commit_id":"a0d1bf01d9e2fa8142e0e19c2a456f591370c283","original_commit_id":"a0d1bf01d9e2fa8142e0e19c2a456f591370c283","user":{"login":"dmitry-a-bogdanov","id":3103958,"avatar_url":"https://avatars.githubusercontent.com/u/3103958?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitry-a-bogdanov","html_url":"https://github.com/dmitry-a-bogdanov","followers_url":"https://api.github.com/users/dmitry-a-bogdanov/followers","following_url":"https://api.github.com/users/dmitry-a-bogdanov/following{/other_user}","gists_url":"https://api.github.com/users/dmitry-a-bogdanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitry-a-bogdanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitry-a-bogdanov/subscriptions","organizations_url":"https://api.github.com/users/dmitry-a-bogdanov/orgs","repos_url":"https://api.github.com/users/dmitry-a-bogdanov/repos","events_url":"https://api.github.com/users/dmitry-a-bogdanov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitry-a-bogdanov/received_events","type":"User","site_admin":false},"body":":exclamation: The function should return an error insead of panicing.","created_at":"2016-03-14T09:21:46Z","updated_at":"2016-03-14T09:21:46Z","html_url":"https://github.com/dmitry-a-bogdanov/bolgenos-ng/pull/32#discussion_r55972663","pull_request_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/comments/55972663"},"html":{"href":"https://github.com/dmitry-a-bogdanov/bolgenos-ng/pull/32#discussion_r55972663"},"pull_request":{"href":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/32","id":62668206,"html_url":"https://github.com/dmitry-a-bogdanov/bolgenos-ng/pull/32","diff_url":"https://github.com/dmitry-a-bogdanov/bolgenos-ng/pull/32.diff","patch_url":"https://github.com/dmitry-a-bogdanov/bolgenos-ng/pull/32.patch","issue_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/issues/32","number":32,"state":"closed","locked":false,"title":"feature/memory_allocation","user":{"login":"dmitry-a-bogdanov","id":3103958,"avatar_url":"https://avatars.githubusercontent.com/u/3103958?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitry-a-bogdanov","html_url":"https://github.com/dmitry-a-bogdanov","followers_url":"https://api.github.com/users/dmitry-a-bogdanov/followers","following_url":"https://api.github.com/users/dmitry-a-bogdanov/following{/other_user}","gists_url":"https://api.github.com/users/dmitry-a-bogdanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitry-a-bogdanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitry-a-bogdanov/subscriptions","organizations_url":"https://api.github.com/users/dmitry-a-bogdanov/orgs","repos_url":"https://api.github.com/users/dmitry-a-bogdanov/repos","events_url":"https://api.github.com/users/dmitry-a-bogdanov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitry-a-bogdanov/received_events","type":"User","site_admin":false},"body":"memory: introduce kmalloc\r\n\r\n* added kmalloc/kfree\r\n* removed templates from memory model\r\n* finished memory allocation model\r\n\r\nActivity: #30 \r\nStatus: closed/ongoing\r\n","created_at":"2016-03-13T11:06:19Z","updated_at":"2016-03-14T09:21:46Z","closed_at":"2016-03-13T11:09:46Z","merged_at":"2016-03-13T11:09:45Z","merge_commit_sha":"8f0a92de061fdc479ed18f6c60b2a21c4d23e7ae","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/32/commits","review_comments_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/32/comments","review_comment_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/issues/32/comments","statuses_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/statuses/a0d1bf01d9e2fa8142e0e19c2a456f591370c283","head":{"label":"dmitry-a-bogdanov:feature/memory_allocation","ref":"feature/memory_allocation","sha":"a0d1bf01d9e2fa8142e0e19c2a456f591370c283","user":{"login":"dmitry-a-bogdanov","id":3103958,"avatar_url":"https://avatars.githubusercontent.com/u/3103958?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitry-a-bogdanov","html_url":"https://github.com/dmitry-a-bogdanov","followers_url":"https://api.github.com/users/dmitry-a-bogdanov/followers","following_url":"https://api.github.com/users/dmitry-a-bogdanov/following{/other_user}","gists_url":"https://api.github.com/users/dmitry-a-bogdanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitry-a-bogdanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitry-a-bogdanov/subscriptions","organizations_url":"https://api.github.com/users/dmitry-a-bogdanov/orgs","repos_url":"https://api.github.com/users/dmitry-a-bogdanov/repos","events_url":"https://api.github.com/users/dmitry-a-bogdanov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitry-a-bogdanov/received_events","type":"User","site_admin":false},"repo":{"id":45307701,"name":"bolgenos-ng","full_name":"dmitry-a-bogdanov/bolgenos-ng","owner":{"login":"dmitry-a-bogdanov","id":3103958,"avatar_url":"https://avatars.githubusercontent.com/u/3103958?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitry-a-bogdanov","html_url":"https://github.com/dmitry-a-bogdanov","followers_url":"https://api.github.com/users/dmitry-a-bogdanov/followers","following_url":"https://api.github.com/users/dmitry-a-bogdanov/following{/other_user}","gists_url":"https://api.github.com/users/dmitry-a-bogdanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitry-a-bogdanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitry-a-bogdanov/subscriptions","organizations_url":"https://api.github.com/users/dmitry-a-bogdanov/orgs","repos_url":"https://api.github.com/users/dmitry-a-bogdanov/repos","events_url":"https://api.github.com/users/dmitry-a-bogdanov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitry-a-bogdanov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmitry-a-bogdanov/bolgenos-ng","description":"","fork":false,"url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng","forks_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/forks","keys_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/teams","hooks_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/hooks","issue_events_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/issues/events{/number}","events_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/events","assignees_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/assignees{/user}","branches_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/branches{/branch}","tags_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/tags","blobs_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/languages","stargazers_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/stargazers","contributors_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/contributors","subscribers_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/subscribers","subscription_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/subscription","commits_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/contents/{+path}","compare_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/merges","archive_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/downloads","issues_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/issues{/number}","pulls_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/labels{/name}","releases_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/releases{/id}","deployments_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/deployments","created_at":"2015-10-31T15:48:48Z","updated_at":"2016-02-27T23:19:13Z","pushed_at":"2016-03-13T11:10:22Z","git_url":"git://github.com/dmitry-a-bogdanov/bolgenos-ng.git","ssh_url":"git@github.com:dmitry-a-bogdanov/bolgenos-ng.git","clone_url":"https://github.com/dmitry-a-bogdanov/bolgenos-ng.git","svn_url":"https://github.com/dmitry-a-bogdanov/bolgenos-ng","homepage":null,"size":274,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"dmitry-a-bogdanov:master","ref":"master","sha":"a2989bea878d9b2190f0a09dd1ad46b1e4bf0178","user":{"login":"dmitry-a-bogdanov","id":3103958,"avatar_url":"https://avatars.githubusercontent.com/u/3103958?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitry-a-bogdanov","html_url":"https://github.com/dmitry-a-bogdanov","followers_url":"https://api.github.com/users/dmitry-a-bogdanov/followers","following_url":"https://api.github.com/users/dmitry-a-bogdanov/following{/other_user}","gists_url":"https://api.github.com/users/dmitry-a-bogdanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitry-a-bogdanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitry-a-bogdanov/subscriptions","organizations_url":"https://api.github.com/users/dmitry-a-bogdanov/orgs","repos_url":"https://api.github.com/users/dmitry-a-bogdanov/repos","events_url":"https://api.github.com/users/dmitry-a-bogdanov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitry-a-bogdanov/received_events","type":"User","site_admin":false},"repo":{"id":45307701,"name":"bolgenos-ng","full_name":"dmitry-a-bogdanov/bolgenos-ng","owner":{"login":"dmitry-a-bogdanov","id":3103958,"avatar_url":"https://avatars.githubusercontent.com/u/3103958?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitry-a-bogdanov","html_url":"https://github.com/dmitry-a-bogdanov","followers_url":"https://api.github.com/users/dmitry-a-bogdanov/followers","following_url":"https://api.github.com/users/dmitry-a-bogdanov/following{/other_user}","gists_url":"https://api.github.com/users/dmitry-a-bogdanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitry-a-bogdanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitry-a-bogdanov/subscriptions","organizations_url":"https://api.github.com/users/dmitry-a-bogdanov/orgs","repos_url":"https://api.github.com/users/dmitry-a-bogdanov/repos","events_url":"https://api.github.com/users/dmitry-a-bogdanov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitry-a-bogdanov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmitry-a-bogdanov/bolgenos-ng","description":"","fork":false,"url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng","forks_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/forks","keys_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/teams","hooks_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/hooks","issue_events_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/issues/events{/number}","events_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/events","assignees_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/assignees{/user}","branches_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/branches{/branch}","tags_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/tags","blobs_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/statuses/{sha}","languages_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/languages","stargazers_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/stargazers","contributors_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/contributors","subscribers_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/subscribers","subscription_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/subscription","commits_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/contents/{+path}","compare_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/merges","archive_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/downloads","issues_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/issues{/number}","pulls_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls{/number}","milestones_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/milestones{/number}","notifications_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/labels{/name}","releases_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/releases{/id}","deployments_url":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/deployments","created_at":"2015-10-31T15:48:48Z","updated_at":"2016-02-27T23:19:13Z","pushed_at":"2016-03-13T11:10:22Z","git_url":"git://github.com/dmitry-a-bogdanov/bolgenos-ng.git","ssh_url":"git@github.com:dmitry-a-bogdanov/bolgenos-ng.git","clone_url":"https://github.com/dmitry-a-bogdanov/bolgenos-ng.git","svn_url":"https://github.com/dmitry-a-bogdanov/bolgenos-ng","homepage":null,"size":274,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/32"},"html":{"href":"https://github.com/dmitry-a-bogdanov/bolgenos-ng/pull/32"},"issue":{"href":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/issues/32"},"comments":{"href":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/dmitry-a-bogdanov/bolgenos-ng/statuses/a0d1bf01d9e2fa8142e0e19c2a456f591370c283"}}}}