{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/1234","labels_url":"https://api.github.com/repos/micropython/micropython/issues/1234/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/1234/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/1234/events","html_url":"https://github.com/micropython/micropython/pull/1234","id":73721194,"number":1234,"title":"split memory manager into \"standard\" malloc/free and gc","user":{"login":"cloudformdesign","id":5587659,"avatar_url":"https://avatars.githubusercontent.com/u/5587659?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudformdesign","html_url":"https://github.com/cloudformdesign","followers_url":"https://api.github.com/users/cloudformdesign/followers","following_url":"https://api.github.com/users/cloudformdesign/following{/other_user}","gists_url":"https://api.github.com/users/cloudformdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudformdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudformdesign/subscriptions","organizations_url":"https://api.github.com/users/cloudformdesign/orgs","repos_url":"https://api.github.com/users/cloudformdesign/repos","events_url":"https://api.github.com/users/cloudformdesign/events{/privacy}","received_events_url":"https://api.github.com/users/cloudformdesign/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2015-05-06T20:01:47Z","updated_at":"2015-06-12T20:23:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/micropython/micropython/pulls/1234","html_url":"https://github.com/micropython/micropython/pull/1234","diff_url":"https://github.com/micropython/micropython/pull/1234.diff","patch_url":"https://github.com/micropython/micropython/pull/1234.patch"},"body":"Completes HALF of #1168\r\n\r\nThis pull request accomplishes the following:\r\n- split the memory manager into semi-standard malloc/free and garbage collector implementations\r\n    - differences are the memory manager MUST provide a `next`, `sizeof`, `valid` and `set_mark`/`clear_mark`/`get_mark` interface. This is a valid requirement, as most micro memory managers I have seen have them (or it would be easy to add them) AND it saves significant space and time.\r\n\r\nStill to do (should be pretty straightforward)\r\n- split up the allocation table into garbage collector and memory pool only attributes\r\n- make the info getting and dumping not dependent at all on `gc.h`\r\n"},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/111604439","html_url":"https://github.com/micropython/micropython/pull/1234#issuecomment-111604439","issue_url":"https://api.github.com/repos/micropython/micropython/issues/1234","id":111604439,"user":{"login":"cloudformdesign","id":5587659,"avatar_url":"https://avatars.githubusercontent.com/u/5587659?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudformdesign","html_url":"https://github.com/cloudformdesign","followers_url":"https://api.github.com/users/cloudformdesign/followers","following_url":"https://api.github.com/users/cloudformdesign/following{/other_user}","gists_url":"https://api.github.com/users/cloudformdesign/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudformdesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudformdesign/subscriptions","organizations_url":"https://api.github.com/users/cloudformdesign/orgs","repos_url":"https://api.github.com/users/cloudformdesign/repos","events_url":"https://api.github.com/users/cloudformdesign/events{/privacy}","received_events_url":"https://api.github.com/users/cloudformdesign/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T20:23:15Z","updated_at":"2015-06-12T20:23:15Z","body":"@pfalcon I ended up doing the gc_sweep first, as it is a pretty simple use case of decoupling. Essentially two things have to be decoupled from the overall memory manager:\r\n1. stepping through all memory (done with `mem_first` and `mem_next`)\r\n2. freeing memory separately (done with `mem_free`)\r\n\r\nIt ended up being a few more lines than 10, but I think it should meet all your qualifications. I tried to not add functionality that was already implemented like you said and keep everything as a macro. There are also comments on how things might be able to be sped up a bit, but I will leave it to you to determine how important that is.\r\n\r\nThank you for taking the time to review my code and offer these tips. I would really like to be a core contributor to this project, and it is obvious that I need to learn the proper way to structure pull requests to do that."}}