{"action":"created","issue":{"url":"https://api.github.com/repos/munificent/wren/issues/310","labels_url":"https://api.github.com/repos/munificent/wren/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/munificent/wren/issues/310/comments","events_url":"https://api.github.com/repos/munificent/wren/issues/310/events","html_url":"https://github.com/munificent/wren/pull/310","id":112242512,"number":310,"title":"Remove Recursive Mark from GC","user":{"login":"iwillspeak","id":1004401,"avatar_url":"https://avatars.githubusercontent.com/u/1004401?v=3","gravatar_id":"","url":"https://api.github.com/users/iwillspeak","html_url":"https://github.com/iwillspeak","followers_url":"https://api.github.com/users/iwillspeak/followers","following_url":"https://api.github.com/users/iwillspeak/following{/other_user}","gists_url":"https://api.github.com/users/iwillspeak/gists{/gist_id}","starred_url":"https://api.github.com/users/iwillspeak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwillspeak/subscriptions","organizations_url":"https://api.github.com/users/iwillspeak/orgs","repos_url":"https://api.github.com/users/iwillspeak/repos","events_url":"https://api.github.com/users/iwillspeak/events{/privacy}","received_events_url":"https://api.github.com/users/iwillspeak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-10-19T22:02:46Z","updated_at":"2015-10-24T21:56:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/munificent/wren/pulls/310","html_url":"https://github.com/munificent/wren/pull/310","diff_url":"https://github.com/munificent/wren/pull/310.diff","patch_url":"https://github.com/munificent/wren/pull/310.patch"},"body":"The previous GC implementation used a recursive mark method. This can\r\nresult in stack overflows when attempting to mark deeply nested objects (#280).\r\n\r\nThis is an initial look at removing the recursive mark method. I've added a\r\nsimple `GCState` object which keeps track of a list of 'gray' objects. Once\r\nwe have finished the initial mark of all the root objects we iterate through\r\nthe gray list, adding each objects referenced objects to the gray list."},"comment":{"url":"https://api.github.com/repos/munificent/wren/issues/comments/150854015","html_url":"https://github.com/munificent/wren/pull/310#issuecomment-150854015","issue_url":"https://api.github.com/repos/munificent/wren/issues/310","id":150854015,"user":{"login":"iwillspeak","id":1004401,"avatar_url":"https://avatars.githubusercontent.com/u/1004401?v=3","gravatar_id":"","url":"https://api.github.com/users/iwillspeak","html_url":"https://github.com/iwillspeak","followers_url":"https://api.github.com/users/iwillspeak/followers","following_url":"https://api.github.com/users/iwillspeak/following{/other_user}","gists_url":"https://api.github.com/users/iwillspeak/gists{/gist_id}","starred_url":"https://api.github.com/users/iwillspeak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwillspeak/subscriptions","organizations_url":"https://api.github.com/users/iwillspeak/orgs","repos_url":"https://api.github.com/users/iwillspeak/repos","events_url":"https://api.github.com/users/iwillspeak/events{/privacy}","received_events_url":"https://api.github.com/users/iwillspeak/received_events","type":"User","site_admin":false},"created_at":"2015-10-24T21:56:01Z","updated_at":"2015-10-24T21:56:01Z","body":"> Clever! I could be wrong, but I don't think it will work, though. :( When we are graying the roots, we don't know their index in the array, and we don't want to do an O(n) seek to find them.\r\n\r\nYep. Unfortunately we don't have enough information to pull this off.\r\n\r\nThanks for the more detailed explanation. I've implemented a simple centralised stack as you suggested. Seems to work pretty well so far, and it's actually a lot simpler than many of my earlier attempts to get this working.\r\n\r\nI guess moving to a centralised array of pointers for the allocated objects isn't really needed.\r\n"}}