{"action":"created","issue":{"url":"https://api.github.com/repos/phil-opp/blog_os/issues/361","repository_url":"https://api.github.com/repos/phil-opp/blog_os","labels_url":"https://api.github.com/repos/phil-opp/blog_os/issues/361/labels{/name}","comments_url":"https://api.github.com/repos/phil-opp/blog_os/issues/361/comments","events_url":"https://api.github.com/repos/phil-opp/blog_os/issues/361/events","html_url":"https://github.com/phil-opp/blog_os/pull/361","id":267177720,"number":361,"title":"A rewrite of the bump allocator to conform to the new API.","user":{"login":"johanmon","id":32909783,"avatar_url":"https://avatars3.githubusercontent.com/u/32909783?v=4","gravatar_id":"","url":"https://api.github.com/users/johanmon","html_url":"https://github.com/johanmon","followers_url":"https://api.github.com/users/johanmon/followers","following_url":"https://api.github.com/users/johanmon/following{/other_user}","gists_url":"https://api.github.com/users/johanmon/gists{/gist_id}","starred_url":"https://api.github.com/users/johanmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanmon/subscriptions","organizations_url":"https://api.github.com/users/johanmon/orgs","repos_url":"https://api.github.com/users/johanmon/repos","events_url":"https://api.github.com/users/johanmon/events{/privacy}","received_events_url":"https://api.github.com/users/johanmon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-20T13:34:27Z","updated_at":"2017-10-22T09:48:49Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/phil-opp/blog_os/pulls/361","html_url":"https://github.com/phil-opp/blog_os/pull/361","diff_url":"https://github.com/phil-opp/blog_os/pull/361.diff","patch_url":"https://github.com/phil-opp/blog_os/pull/361.patch"},"body":"This version follows the new interface. I've tried to make the transition to the existing version of the hole_list_allocator easier so I've kept that pattern of having a init() function etc. \r\n\r\nIf this version of the bump allocator is ok I could do a rewrite of the instructions in the blog."},"comment":{"url":"https://api.github.com/repos/phil-opp/blog_os/issues/comments/338464980","html_url":"https://github.com/phil-opp/blog_os/pull/361#issuecomment-338464980","issue_url":"https://api.github.com/repos/phil-opp/blog_os/issues/361","id":338464980,"user":{"login":"phil-opp","id":1131315,"avatar_url":"https://avatars2.githubusercontent.com/u/1131315?v=4","gravatar_id":"","url":"https://api.github.com/users/phil-opp","html_url":"https://github.com/phil-opp","followers_url":"https://api.github.com/users/phil-opp/followers","following_url":"https://api.github.com/users/phil-opp/following{/other_user}","gists_url":"https://api.github.com/users/phil-opp/gists{/gist_id}","starred_url":"https://api.github.com/users/phil-opp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phil-opp/subscriptions","organizations_url":"https://api.github.com/users/phil-opp/orgs","repos_url":"https://api.github.com/users/phil-opp/repos","events_url":"https://api.github.com/users/phil-opp/events{/privacy}","received_events_url":"https://api.github.com/users/phil-opp/received_events","type":"User","site_admin":false},"created_at":"2017-10-22T09:48:49Z","updated_at":"2017-10-22T09:48:49Z","author_association":"OWNER","body":"> The bump allocator as it is now needs to be initialized by the kernel. If this is so, the HEAP_START and HEAP_SIZE could move to the kernel lib.rs and this makes more sense.\r\n\r\nSounds good!\r\n\r\n> One thing that struck me, the init(offset, size) function need not be unsafe does it?\r\n\r\nThe function implementation itself works fine without unsafe. The question is: Can we do something bad with the safe methods of a wrongly initialized allocator? If yes, we should mark `init`as unsafe, even if it doesn't do anything unsafe itself.\r\n\r\nIn this case, I'm not quite sure. We never write to any memory location (or do we?), so we just return invalid raw pointers on wrong initialization. So the unsafe steps should be just dereferencing the returned raw pointer or using the allocator as `global_allocator`, which are both outside of the interface. Or am I missing something? "}}
{"actor":{"display_login":"phil-opp"}}