{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/1172","labels_url":"https://api.github.com/repos/micropython/micropython/issues/1172/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/1172/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/1172/events","html_url":"https://github.com/micropython/micropython/pull/1172","id":64876724,"number":1172,"title":"Add \"Stackless\" support (don't use C stack to call bytecode functions) ","user":{"login":"pfalcon","id":500451,"avatar_url":"https://avatars.githubusercontent.com/u/500451?v=3","gravatar_id":"","url":"https://api.github.com/users/pfalcon","html_url":"https://github.com/pfalcon","followers_url":"https://api.github.com/users/pfalcon/followers","following_url":"https://api.github.com/users/pfalcon/following{/other_user}","gists_url":"https://api.github.com/users/pfalcon/gists{/gist_id}","starred_url":"https://api.github.com/users/pfalcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfalcon/subscriptions","organizations_url":"https://api.github.com/users/pfalcon/orgs","repos_url":"https://api.github.com/users/pfalcon/repos","events_url":"https://api.github.com/users/pfalcon/events{/privacy}","received_events_url":"https://api.github.com/users/pfalcon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-28T00:20:30Z","updated_at":"2015-04-02T11:49:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/micropython/micropython/pulls/1172","html_url":"https://github.com/micropython/micropython/pull/1172","diff_url":"https://github.com/micropython/micropython/pull/1172.diff","patch_url":"https://github.com/micropython/micropython/pull/1172.patch"},"body":"I finally think this is ready to be merged. The feature was implemented mostly during long flight day, and I was pretty surprised it went so smooth - I expected it to be more complicated. There were still few issues to resolve after that, but they were tackled too, and I rebased and fixed any uncovered issues for more than month.\r\n\r\nSo, there're 2 stackless modes: strict and non-strict. Fairly speaking, only strict is interesting in formal features it allows, non-strict was separated out to make the testsuite pass. In strict mode, heapalloc.py expectedly fail - because what it tests is that after heap is exhausted it's still possible to do some memory-requiring operations, which are not possible in stackless mode, because all allocations happen off heap (non-strict just switches to stack in this case). With that in mind, non-strict mode still may be pragmatically interesting for low-RAM ports, because it arguably (but not proven) saves on (bg) size of C stack.\r\n\r\nOriginal commits are provided to show development process. For merging, it may make sense to squash them  into smaller number, but probably still not 1.\r\n"},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/88875351","html_url":"https://github.com/micropython/micropython/pull/1172#issuecomment-88875351","issue_url":"https://api.github.com/repos/micropython/micropython/issues/1172","id":88875351,"user":{"login":"dpgeorge","id":6187689,"avatar_url":"https://avatars.githubusercontent.com/u/6187689?v=3","gravatar_id":"","url":"https://api.github.com/users/dpgeorge","html_url":"https://github.com/dpgeorge","followers_url":"https://api.github.com/users/dpgeorge/followers","following_url":"https://api.github.com/users/dpgeorge/following{/other_user}","gists_url":"https://api.github.com/users/dpgeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/dpgeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpgeorge/subscriptions","organizations_url":"https://api.github.com/users/dpgeorge/orgs","repos_url":"https://api.github.com/users/dpgeorge/repos","events_url":"https://api.github.com/users/dpgeorge/events{/privacy}","received_events_url":"https://api.github.com/users/dpgeorge/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T11:49:22Z","updated_at":"2015-04-02T11:49:22Z","body":"Of course, the slow down is because memory allocation on the heap is slow.  Probably it could be improved by explicitly freeing the allocated codestate when unwinding the call stack."}}