{"action":"opened","number":343,"pull_request":{"url":"https://api.github.com/repos/metaeducation/ren-c/pulls/343","id":95746855,"html_url":"https://github.com/metaeducation/ren-c/pull/343","diff_url":"https://github.com/metaeducation/ren-c/pull/343.diff","patch_url":"https://github.com/metaeducation/ren-c/pull/343.patch","issue_url":"https://api.github.com/repos/metaeducation/ren-c/issues/343","number":343,"state":"open","locked":false,"title":"Unentangle FFI code from core GC, some GC streamlining","user":{"login":"hostilefork","id":20440,"avatar_url":"https://avatars.githubusercontent.com/u/20440?v=3","gravatar_id":"","url":"https://api.github.com/users/hostilefork","html_url":"https://github.com/hostilefork","followers_url":"https://api.github.com/users/hostilefork/followers","following_url":"https://api.github.com/users/hostilefork/following{/other_user}","gists_url":"https://api.github.com/users/hostilefork/gists{/gist_id}","starred_url":"https://api.github.com/users/hostilefork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hostilefork/subscriptions","organizations_url":"https://api.github.com/users/hostilefork/orgs","repos_url":"https://api.github.com/users/hostilefork/repos","events_url":"https://api.github.com/users/hostilefork/events{/privacy}","received_events_url":"https://api.github.com/users/hostilefork/received_events","type":"User","site_admin":false},"body":"The FFI implementation originally used dedicated C structures, which\r\nwere allocated from a specialized memory pool.  This required some\r\nfairly invasive changes to the GC in order to put these structures\r\ninto the graph of \"live\" references for the system.  Because these\r\nspecialized structures had their own GC code, it was also not as\r\ncomplete as the system's ordinary code...meaning deeply nested\r\nstructures could overflow the stack.\r\n\r\nRather than keep expanding or bulletproofing that approach, this moves\r\nin the other direction to get rid of the specialized code.  The \"REBRIN\"\r\nand \"struct Reb_Field\" have been turned into ordinary BLOCK!s, which\r\nare candidates for further becoming ordinary OBJECT!s (with keylists).\r\n\r\nThis change allows all the FFI-oriented code to be removed from\r\n%m-gc.c...simplifying the garbage collector, and meaning that non-FFI\r\nbuilds aren't paying for code in the core related to that.  It also focuses\r\nthe core on enhancing generalized features that provide benefit across\r\nthe board, without the risk of brittle specialized code for the FFI structures.\r\n\r\n*(A similar process is to be pursued for GOB!, codecs, devices, and events,\r\nto the extent it is possible to do so.)*\r\n\r\nAlso included is a thorough going-over of the mark-and-sweep garbage\r\ncollector code, with an eye toward catching edge cases and simplification.\r\nSeveral changes likely improve the performance some amount, by\r\navoiding redundant markings or checks.  However, the big push was\r\nto reduce the total amount of code and improve the quality of the\r\ncomments and function names.\r\n\r\nOne vetting that this does is to completely eliminate C stack recursion\r\nin the GC.  Deeply nested structures in R3-Alpha could overflow the\r\nC call stack with Mark_Array calling Mark_Array calling Mark_Array...\r\nbut that was solved with a queue in Ren-C.  However, that wasn't the\r\nonly possible problem, just the most likely.\r\n\r\nWith additions like objects having meta objects, if you call\r\nQueue_Mark_Context of CTX_META(context) from inside Queue_Mark_Context\r\nyou could theoretically get the same problem.  The same goes for\r\nmarking underlying functions while marking a function.  While neither\r\nof these are too likely to make chains too long for the C stack, it\r\nis possible--and the discipline of organizing the code to stop this\r\nkind of problem helps for any similar patterns which *would* be\r\nlikely.","created_at":"2016-11-29T18:18:15Z","updated_at":"2016-11-29T18:18:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/343/commits","review_comments_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/343/comments","review_comment_url":"https://api.github.com/repos/metaeducation/ren-c/pulls/comments{/number}","comments_url":"https://api.github.com/repos/metaeducation/ren-c/issues/343/comments","statuses_url":"https://api.github.com/repos/metaeducation/ren-c/statuses/33bdd7da622533c4af7984247dfec0195d53c101","head":{"label":"hostilefork:less-ffi-code","ref":"less-ffi-code","sha":"33bdd7da622533c4af7984247dfec0195d53c101","user":{"login":"hostilefork","id":20440,"avatar_url":"https://avatars.githubusercontent.com/u/20440?v=3","gravatar_id":"","url":"https://api.github.com/users/hostilefork","html_url":"https://github.com/hostilefork","followers_url":"https://api.github.com/users/hostilefork/followers","following_url":"https://api.github.com/users/hostilefork/following{/other_user}","gists_url":"https://api.github.com/users/hostilefork/gists{/gist_id}","starred_url":"https://api.github.com/users/hostilefork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hostilefork/subscriptions","organizations_url":"https://api.github.com/users/hostilefork/orgs","repos_url":"https://api.github.com/users/hostilefork/repos","events_url":"https://api.github.com/users/hostilefork/events{/privacy}","received_events_url":"https://api.github.com/users/hostilefork/received_events","type":"User","site_admin":false},"repo":{"id":7182655,"name":"rebol","full_name":"hostilefork/rebol","owner":{"login":"hostilefork","id":20440,"avatar_url":"https://avatars.githubusercontent.com/u/20440?v=3","gravatar_id":"","url":"https://api.github.com/users/hostilefork","html_url":"https://github.com/hostilefork","followers_url":"https://api.github.com/users/hostilefork/followers","following_url":"https://api.github.com/users/hostilefork/following{/other_user}","gists_url":"https://api.github.com/users/hostilefork/gists{/gist_id}","starred_url":"https://api.github.com/users/hostilefork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hostilefork/subscriptions","organizations_url":"https://api.github.com/users/hostilefork/orgs","repos_url":"https://api.github.com/users/hostilefork/repos","events_url":"https://api.github.com/users/hostilefork/events{/privacy}","received_events_url":"https://api.github.com/users/hostilefork/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hostilefork/rebol","description":"Source code for the Rebol interpreter","fork":true,"url":"https://api.github.com/repos/hostilefork/rebol","forks_url":"https://api.github.com/repos/hostilefork/rebol/forks","keys_url":"https://api.github.com/repos/hostilefork/rebol/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hostilefork/rebol/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hostilefork/rebol/teams","hooks_url":"https://api.github.com/repos/hostilefork/rebol/hooks","issue_events_url":"https://api.github.com/repos/hostilefork/rebol/issues/events{/number}","events_url":"https://api.github.com/repos/hostilefork/rebol/events","assignees_url":"https://api.github.com/repos/hostilefork/rebol/assignees{/user}","branches_url":"https://api.github.com/repos/hostilefork/rebol/branches{/branch}","tags_url":"https://api.github.com/repos/hostilefork/rebol/tags","blobs_url":"https://api.github.com/repos/hostilefork/rebol/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hostilefork/rebol/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hostilefork/rebol/git/refs{/sha}","trees_url":"https://api.github.com/repos/hostilefork/rebol/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hostilefork/rebol/statuses/{sha}","languages_url":"https://api.github.com/repos/hostilefork/rebol/languages","stargazers_url":"https://api.github.com/repos/hostilefork/rebol/stargazers","contributors_url":"https://api.github.com/repos/hostilefork/rebol/contributors","subscribers_url":"https://api.github.com/repos/hostilefork/rebol/subscribers","subscription_url":"https://api.github.com/repos/hostilefork/rebol/subscription","commits_url":"https://api.github.com/repos/hostilefork/rebol/commits{/sha}","git_commits_url":"https://api.github.com/repos/hostilefork/rebol/git/commits{/sha}","comments_url":"https://api.github.com/repos/hostilefork/rebol/comments{/number}","issue_comment_url":"https://api.github.com/repos/hostilefork/rebol/issues/comments{/number}","contents_url":"https://api.github.com/repos/hostilefork/rebol/contents/{+path}","compare_url":"https://api.github.com/repos/hostilefork/rebol/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hostilefork/rebol/merges","archive_url":"https://api.github.com/repos/hostilefork/rebol/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hostilefork/rebol/downloads","issues_url":"https://api.github.com/repos/hostilefork/rebol/issues{/number}","pulls_url":"https://api.github.com/repos/hostilefork/rebol/pulls{/number}","milestones_url":"https://api.github.com/repos/hostilefork/rebol/milestones{/number}","notifications_url":"https://api.github.com/repos/hostilefork/rebol/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hostilefork/rebol/labels{/name}","releases_url":"https://api.github.com/repos/hostilefork/rebol/releases{/id}","deployments_url":"https://api.github.com/repos/hostilefork/rebol/deployments","created_at":"2012-12-15T18:44:43Z","updated_at":"2016-05-26T01:04:22Z","pushed_at":"2016-11-29T18:10:01Z","git_url":"git://github.com/hostilefork/rebol.git","ssh_url":"git@github.com:hostilefork/rebol.git","clone_url":"https://github.com/hostilefork/rebol.git","svn_url":"https://github.com/hostilefork/rebol","homepage":"http://www.rebol.com/","size":52263,"stargazers_count":6,"watchers_count":6,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":6,"default_branch":"master"}},"base":{"label":"metaeducation:master","ref":"master","sha":"c3b442cec5a9a14361344090039080a03d41b048","user":{"login":"metaeducation","id":8308455,"avatar_url":"https://avatars.githubusercontent.com/u/8308455?v=3","gravatar_id":"","url":"https://api.github.com/users/metaeducation","html_url":"https://github.com/metaeducation","followers_url":"https://api.github.com/users/metaeducation/followers","following_url":"https://api.github.com/users/metaeducation/following{/other_user}","gists_url":"https://api.github.com/users/metaeducation/gists{/gist_id}","starred_url":"https://api.github.com/users/metaeducation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metaeducation/subscriptions","organizations_url":"https://api.github.com/users/metaeducation/orgs","repos_url":"https://api.github.com/users/metaeducation/repos","events_url":"https://api.github.com/users/metaeducation/events{/privacy}","received_events_url":"https://api.github.com/users/metaeducation/received_events","type":"Organization","site_admin":false},"repo":{"id":35589720,"name":"ren-c","full_name":"metaeducation/ren-c","owner":{"login":"metaeducation","id":8308455,"avatar_url":"https://avatars.githubusercontent.com/u/8308455?v=3","gravatar_id":"","url":"https://api.github.com/users/metaeducation","html_url":"https://github.com/metaeducation","followers_url":"https://api.github.com/users/metaeducation/followers","following_url":"https://api.github.com/users/metaeducation/following{/other_user}","gists_url":"https://api.github.com/users/metaeducation/gists{/gist_id}","starred_url":"https://api.github.com/users/metaeducation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metaeducation/subscriptions","organizations_url":"https://api.github.com/users/metaeducation/orgs","repos_url":"https://api.github.com/users/metaeducation/repos","events_url":"https://api.github.com/users/metaeducation/events{/privacy}","received_events_url":"https://api.github.com/users/metaeducation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/metaeducation/ren-c","description":"Library for embedding a Rebol interpreter into C codebases","fork":true,"url":"https://api.github.com/repos/metaeducation/ren-c","forks_url":"https://api.github.com/repos/metaeducation/ren-c/forks","keys_url":"https://api.github.com/repos/metaeducation/ren-c/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metaeducation/ren-c/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metaeducation/ren-c/teams","hooks_url":"https://api.github.com/repos/metaeducation/ren-c/hooks","issue_events_url":"https://api.github.com/repos/metaeducation/ren-c/issues/events{/number}","events_url":"https://api.github.com/repos/metaeducation/ren-c/events","assignees_url":"https://api.github.com/repos/metaeducation/ren-c/assignees{/user}","branches_url":"https://api.github.com/repos/metaeducation/ren-c/branches{/branch}","tags_url":"https://api.github.com/repos/metaeducation/ren-c/tags","blobs_url":"https://api.github.com/repos/metaeducation/ren-c/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metaeducation/ren-c/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metaeducation/ren-c/git/refs{/sha}","trees_url":"https://api.github.com/repos/metaeducation/ren-c/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metaeducation/ren-c/statuses/{sha}","languages_url":"https://api.github.com/repos/metaeducation/ren-c/languages","stargazers_url":"https://api.github.com/repos/metaeducation/ren-c/stargazers","contributors_url":"https://api.github.com/repos/metaeducation/ren-c/contributors","subscribers_url":"https://api.github.com/repos/metaeducation/ren-c/subscribers","subscription_url":"https://api.github.com/repos/metaeducation/ren-c/subscription","commits_url":"https://api.github.com/repos/metaeducation/ren-c/commits{/sha}","git_commits_url":"https://api.github.com/repos/metaeducation/ren-c/git/commits{/sha}","comments_url":"https://api.github.com/repos/metaeducation/ren-c/comments{/number}","issue_comment_url":"https://api.github.com/repos/metaeducation/ren-c/issues/comments{/number}","contents_url":"https://api.github.com/repos/metaeducation/ren-c/contents/{+path}","compare_url":"https://api.github.com/repos/metaeducation/ren-c/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metaeducation/ren-c/merges","archive_url":"https://api.github.com/repos/metaeducation/ren-c/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metaeducation/ren-c/downloads","issues_url":"https://api.github.com/repos/metaeducation/ren-c/issues{/number}","pulls_url":"https://api.github.com/repos/metaeducation/ren-c/pulls{/number}","milestones_url":"https://api.github.com/repos/metaeducation/ren-c/milestones{/number}","notifications_url":"https://api.github.com/repos/metaeducation/ren-c/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metaeducation/ren-c/labels{/name}","releases_url":"https://api.github.com/repos/metaeducation/ren-c/releases{/id}","deployments_url":"https://api.github.com/repos/metaeducation/ren-c/deployments","created_at":"2015-05-14T03:55:55Z","updated_at":"2016-10-23T18:25:53Z","pushed_at":"2016-11-29T03:38:14Z","git_url":"git://github.com/metaeducation/ren-c.git","ssh_url":"git@github.com:metaeducation/ren-c.git","clone_url":"https://github.com/metaeducation/ren-c.git","svn_url":"https://github.com/metaeducation/ren-c","homepage":"","size":52740,"stargazers_count":38,"watchers_count":38,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":15,"forks":13,"open_issues":15,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/343"},"html":{"href":"https://github.com/metaeducation/ren-c/pull/343"},"issue":{"href":"https://api.github.com/repos/metaeducation/ren-c/issues/343"},"comments":{"href":"https://api.github.com/repos/metaeducation/ren-c/issues/343/comments"},"review_comments":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/343/comments"},"review_comment":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/metaeducation/ren-c/pulls/343/commits"},"statuses":{"href":"https://api.github.com/repos/metaeducation/ren-c/statuses/33bdd7da622533c4af7984247dfec0195d53c101"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":6,"additions":2619,"deletions":2510,"changed_files":20}}
{"actor":{"display_login":"hostilefork"}}