{"action":"created","comment":{"url":"https://api.github.com/repos/Baystation12/Baystation12/pulls/comments/27643197","id":27643197,"diff_hunk":"@@ -0,0 +1,160 @@\n+var/datum/controller/process/garbage_collector/garbage_collector\r\n+\r\n+// #define GC_DEBUG 1\r\n+/datum/controller/process/garbage_collector\r\n+\tvar/collection_timeout = 300\t//deciseconds to wait to let running procs finish before we just say fuck it and force del() the object\r\n+\tvar/max_checks_multiplier = 5\t//multiplier (per-decisecond) for calculating max number of tests per SS tick. These tests check if our GC'd objects are actually GC'd\r\n+\tvar/max_forcedel_multiplier = 1\t//multiplier (per-decisecond) for calculating max number of force del() calls per SS tick.\r\n+\r\n+\tvar/dels = 0\t\t\t\t// number of del()'s we've done this tick\r\n+\tvar/list/destroyed = list() // list of refID's of things that should be garbage collected\r\n+\t\t\t\t\t\t\t\t// refID's are associated with the time at which they time out and need to be manually del()\r\n+\t\t\t\t\t\t\t\t// we do this so we aren't constantly locating them and preventing them from being gc'd\r\n+\r\n+\tvar/list/logging = list()\t// list of all types that have failed to GC associated with the number of times that's happened.\r\n+\t\t\t\t\t\t\t\t// the types are stored as strings\r\n+\r\n+/datum/controller/process/garbage_collector/setup()\r\n+\tname = \"garbage\"\r\n+\tschedule_interval = 20 // every 2 seconds\r\n+\r\n+\tif(!garbage_collector)\r\n+\t\tgarbage_collector = src\r\n+\r\n+/datum/controller/process/garbage_collector/doWork()\r\n+\tdels = 0\r\n+\r\n+\tvar/time_to_kill = world.time - collection_timeout // Anything qdel() but not GC'd BEFORE this time needs to be manually del()\r\n+\tvar/checkRemain = max_checks_multiplier * schedule_interval\r\n+\tvar/maxDels = max_forcedel_multiplier * schedule_interval\r\n+\r\n+\twhile(destroyed.len && --checkRemain >= 0)\r\n+\t\tif(dels >= maxDels)\r\n+\t\t\t#ifdef GC_DEBUG\r\n+\t\t\ttesting(\"GC: Reached max force dels per tick [dels] vs [GC_FORCE_DEL_PER_TICK]\")\r\n+\t\t\t#endif\r\n+\t\t\tbreak // Server's already pretty pounded, everything else can wait 2 seconds\r\n+\t\tvar/refID = destroyed[1]\r\n+\t\tvar/GCd_at_time = destroyed[refID]\r\n+\t\tif(GCd_at_time > time_to_kill)\r\n+\t\t\t#ifdef GC_DEBUG\r\n+\t\t\ttesting(\"GC: [refID] not old enough, breaking at [world.time] for [GCd_at_time - time_to_kill] deciseconds until [GCd_at_time + GC_COLLECTION_TIMEOUT]\")\r\n+\t\t\t#endif\r\n+\t\t\tbreak // Everything else is newer, skip them\r\n+\t\tvar/atom/A = locate(refID)\r\n+\t\t#ifdef GC_DEBUG\r\n+\t\ttesting(\"GC: [refID] old enough to test: GCd_at_time: [GCd_at_time] time_to_kill: [time_to_kill] current: [world.time]\")\r\n+\t\t#endif\r\n+\t\tif(A && A.gc_destroyed == GCd_at_time) // So if something else coincidently gets the same ref, it's not deleted by mistake\r\n+\t\t\t// Something's still referring to the qdel'd object.  Kill it.\r\n+\t\t\ttesting(\"GC: -- \\ref[A] | [A.type] was unable to be GC'd and was deleted --\")\r\n+\t\t\tlogging[\"[A.type]\"]++\r\n+\t\t\tdel(A)\r\n+\t\t\t++dels\r\n+\t\t#ifdef GC_DEBUG\r\n+\t\telse\r\n+\t\t\ttesting(\"GC: [refID] properly GC'd at [world.time] with timeout [GCd_at_time]\")\r\n+\t\t#endif\r\n+\t\tdestroyed.Cut(1, 2)\r","path":"code/controllers/Processes/garbage.dm","position":58,"original_position":58,"commit_id":"6d71ca9af90b4cae12cba1a2933e5ececb2bd9d4","original_commit_id":"002bc74894838577c87626349c3213cd620794f3","user":{"login":"Glloyd","id":3977048,"avatar_url":"https://avatars.githubusercontent.com/u/3977048?v=3","gravatar_id":"","url":"https://api.github.com/users/Glloyd","html_url":"https://github.com/Glloyd","followers_url":"https://api.github.com/users/Glloyd/followers","following_url":"https://api.github.com/users/Glloyd/following{/other_user}","gists_url":"https://api.github.com/users/Glloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/Glloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glloyd/subscriptions","organizations_url":"https://api.github.com/users/Glloyd/orgs","repos_url":"https://api.github.com/users/Glloyd/repos","events_url":"https://api.github.com/users/Glloyd/events{/privacy}","received_events_url":"https://api.github.com/users/Glloyd/received_events","type":"User","site_admin":false},"body":"Fair enough, I was just thinking about keeping the processes standardized. Disregard me, I'm about to go to bed.","created_at":"2015-04-02T09:32:06Z","updated_at":"2015-04-02T09:32:06Z","html_url":"https://github.com/Baystation12/Baystation12/pull/8707#discussion_r27643197","pull_request_url":"https://api.github.com/repos/Baystation12/Baystation12/pulls/8707","_links":{"self":{"href":"https://api.github.com/repos/Baystation12/Baystation12/pulls/comments/27643197"},"html":{"href":"https://github.com/Baystation12/Baystation12/pull/8707#discussion_r27643197"},"pull_request":{"href":"https://api.github.com/repos/Baystation12/Baystation12/pulls/8707"}}},"pull_request":{"url":"https://api.github.com/repos/Baystation12/Baystation12/pulls/8707","id":32432071,"html_url":"https://github.com/Baystation12/Baystation12/pull/8707","diff_url":"https://github.com/Baystation12/Baystation12/pull/8707.diff","patch_url":"https://github.com/Baystation12/Baystation12/pull/8707.patch","issue_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/8707","number":8707,"state":"open","locked":false,"title":"Ports /vg/&/tg/'s garbage collector.","user":{"login":"PsiOmegaDelta","id":496895,"avatar_url":"https://avatars.githubusercontent.com/u/496895?v=3","gravatar_id":"","url":"https://api.github.com/users/PsiOmegaDelta","html_url":"https://github.com/PsiOmegaDelta","followers_url":"https://api.github.com/users/PsiOmegaDelta/followers","following_url":"https://api.github.com/users/PsiOmegaDelta/following{/other_user}","gists_url":"https://api.github.com/users/PsiOmegaDelta/gists{/gist_id}","starred_url":"https://api.github.com/users/PsiOmegaDelta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PsiOmegaDelta/subscriptions","organizations_url":"https://api.github.com/users/PsiOmegaDelta/orgs","repos_url":"https://api.github.com/users/PsiOmegaDelta/repos","events_url":"https://api.github.com/users/PsiOmegaDelta/events{/privacy}","received_events_url":"https://api.github.com/users/PsiOmegaDelta/received_events","type":"User","site_admin":false},"body":"It's happening. Kind of. The code is there now.\r\n:no_mouth::sweat_drops:\r\n\r\nWast majority of the code is now /tg/-based instead.","created_at":"2015-04-01T15:49:22Z","updated_at":"2015-04-02T09:32:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9b425b641dfee5e418e5384819c3315baf74d17","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Baystation12/Baystation12/pulls/8707/commits","review_comments_url":"https://api.github.com/repos/Baystation12/Baystation12/pulls/8707/comments","review_comment_url":"https://api.github.com/repos/Baystation12/Baystation12/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/8707/comments","statuses_url":"https://api.github.com/repos/Baystation12/Baystation12/statuses/6d71ca9af90b4cae12cba1a2933e5ececb2bd9d4","head":{"label":"PsiOmegaDelta:Garbage","ref":"Garbage","sha":"6d71ca9af90b4cae12cba1a2933e5ececb2bd9d4","user":{"login":"PsiOmegaDelta","id":496895,"avatar_url":"https://avatars.githubusercontent.com/u/496895?v=3","gravatar_id":"","url":"https://api.github.com/users/PsiOmegaDelta","html_url":"https://github.com/PsiOmegaDelta","followers_url":"https://api.github.com/users/PsiOmegaDelta/followers","following_url":"https://api.github.com/users/PsiOmegaDelta/following{/other_user}","gists_url":"https://api.github.com/users/PsiOmegaDelta/gists{/gist_id}","starred_url":"https://api.github.com/users/PsiOmegaDelta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PsiOmegaDelta/subscriptions","organizations_url":"https://api.github.com/users/PsiOmegaDelta/orgs","repos_url":"https://api.github.com/users/PsiOmegaDelta/repos","events_url":"https://api.github.com/users/PsiOmegaDelta/events{/privacy}","received_events_url":"https://api.github.com/users/PsiOmegaDelta/received_events","type":"User","site_admin":false},"repo":{"id":18328813,"name":"Baystation12","full_name":"PsiOmegaDelta/Baystation12","owner":{"login":"PsiOmegaDelta","id":496895,"avatar_url":"https://avatars.githubusercontent.com/u/496895?v=3","gravatar_id":"","url":"https://api.github.com/users/PsiOmegaDelta","html_url":"https://github.com/PsiOmegaDelta","followers_url":"https://api.github.com/users/PsiOmegaDelta/followers","following_url":"https://api.github.com/users/PsiOmegaDelta/following{/other_user}","gists_url":"https://api.github.com/users/PsiOmegaDelta/gists{/gist_id}","starred_url":"https://api.github.com/users/PsiOmegaDelta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PsiOmegaDelta/subscriptions","organizations_url":"https://api.github.com/users/PsiOmegaDelta/orgs","repos_url":"https://api.github.com/users/PsiOmegaDelta/repos","events_url":"https://api.github.com/users/PsiOmegaDelta/events{/privacy}","received_events_url":"https://api.github.com/users/PsiOmegaDelta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PsiOmegaDelta/Baystation12","description":"The code for Baystation12's branch of SS13. Developers: please don't forget to update the changelog. Thanks!","fork":true,"url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12","forks_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/forks","keys_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/teams","hooks_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/hooks","issue_events_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/issues/events{/number}","events_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/events","assignees_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/assignees{/user}","branches_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/branches{/branch}","tags_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/tags","blobs_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/git/refs{/sha}","trees_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/statuses/{sha}","languages_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/languages","stargazers_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/stargazers","contributors_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/contributors","subscribers_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/subscribers","subscription_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/subscription","commits_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/commits{/sha}","git_commits_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/git/commits{/sha}","comments_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/comments{/number}","issue_comment_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/issues/comments{/number}","contents_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/contents/{+path}","compare_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/merges","archive_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/downloads","issues_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/issues{/number}","pulls_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/pulls{/number}","milestones_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/milestones{/number}","notifications_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/labels{/name}","releases_url":"https://api.github.com/repos/PsiOmegaDelta/Baystation12/releases{/id}","created_at":"2014-04-01T12:34:43Z","updated_at":"2014-06-25T15:21:36Z","pushed_at":"2015-04-02T09:25:43Z","git_url":"git://github.com/PsiOmegaDelta/Baystation12.git","ssh_url":"git@github.com:PsiOmegaDelta/Baystation12.git","clone_url":"https://github.com/PsiOmegaDelta/Baystation12.git","svn_url":"https://github.com/PsiOmegaDelta/Baystation12","homepage":"http://baystation12.net/","size":562318,"stargazers_count":0,"watchers_count":0,"language":"DM","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Baystation12:dev","ref":"dev","sha":"16ecb75a3058638f1eecbba8a2f8857f9f6936e6","user":{"login":"Baystation12","id":1174322,"avatar_url":"https://avatars.githubusercontent.com/u/1174322?v=3","gravatar_id":"","url":"https://api.github.com/users/Baystation12","html_url":"https://github.com/Baystation12","followers_url":"https://api.github.com/users/Baystation12/followers","following_url":"https://api.github.com/users/Baystation12/following{/other_user}","gists_url":"https://api.github.com/users/Baystation12/gists{/gist_id}","starred_url":"https://api.github.com/users/Baystation12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baystation12/subscriptions","organizations_url":"https://api.github.com/users/Baystation12/orgs","repos_url":"https://api.github.com/users/Baystation12/repos","events_url":"https://api.github.com/users/Baystation12/events{/privacy}","received_events_url":"https://api.github.com/users/Baystation12/received_events","type":"Organization","site_admin":false},"repo":{"id":2715933,"name":"Baystation12","full_name":"Baystation12/Baystation12","owner":{"login":"Baystation12","id":1174322,"avatar_url":"https://avatars.githubusercontent.com/u/1174322?v=3","gravatar_id":"","url":"https://api.github.com/users/Baystation12","html_url":"https://github.com/Baystation12","followers_url":"https://api.github.com/users/Baystation12/followers","following_url":"https://api.github.com/users/Baystation12/following{/other_user}","gists_url":"https://api.github.com/users/Baystation12/gists{/gist_id}","starred_url":"https://api.github.com/users/Baystation12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baystation12/subscriptions","organizations_url":"https://api.github.com/users/Baystation12/orgs","repos_url":"https://api.github.com/users/Baystation12/repos","events_url":"https://api.github.com/users/Baystation12/events{/privacy}","received_events_url":"https://api.github.com/users/Baystation12/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Baystation12/Baystation12","description":"The code for Baystation12's branch of SS13","fork":false,"url":"https://api.github.com/repos/Baystation12/Baystation12","forks_url":"https://api.github.com/repos/Baystation12/Baystation12/forks","keys_url":"https://api.github.com/repos/Baystation12/Baystation12/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Baystation12/Baystation12/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Baystation12/Baystation12/teams","hooks_url":"https://api.github.com/repos/Baystation12/Baystation12/hooks","issue_events_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/events{/number}","events_url":"https://api.github.com/repos/Baystation12/Baystation12/events","assignees_url":"https://api.github.com/repos/Baystation12/Baystation12/assignees{/user}","branches_url":"https://api.github.com/repos/Baystation12/Baystation12/branches{/branch}","tags_url":"https://api.github.com/repos/Baystation12/Baystation12/tags","blobs_url":"https://api.github.com/repos/Baystation12/Baystation12/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Baystation12/Baystation12/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Baystation12/Baystation12/git/refs{/sha}","trees_url":"https://api.github.com/repos/Baystation12/Baystation12/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Baystation12/Baystation12/statuses/{sha}","languages_url":"https://api.github.com/repos/Baystation12/Baystation12/languages","stargazers_url":"https://api.github.com/repos/Baystation12/Baystation12/stargazers","contributors_url":"https://api.github.com/repos/Baystation12/Baystation12/contributors","subscribers_url":"https://api.github.com/repos/Baystation12/Baystation12/subscribers","subscription_url":"https://api.github.com/repos/Baystation12/Baystation12/subscription","commits_url":"https://api.github.com/repos/Baystation12/Baystation12/commits{/sha}","git_commits_url":"https://api.github.com/repos/Baystation12/Baystation12/git/commits{/sha}","comments_url":"https://api.github.com/repos/Baystation12/Baystation12/comments{/number}","issue_comment_url":"https://api.github.com/repos/Baystation12/Baystation12/issues/comments{/number}","contents_url":"https://api.github.com/repos/Baystation12/Baystation12/contents/{+path}","compare_url":"https://api.github.com/repos/Baystation12/Baystation12/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Baystation12/Baystation12/merges","archive_url":"https://api.github.com/repos/Baystation12/Baystation12/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Baystation12/Baystation12/downloads","issues_url":"https://api.github.com/repos/Baystation12/Baystation12/issues{/number}","pulls_url":"https://api.github.com/repos/Baystation12/Baystation12/pulls{/number}","milestones_url":"https://api.github.com/repos/Baystation12/Baystation12/milestones{/number}","notifications_url":"https://api.github.com/repos/Baystation12/Baystation12/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Baystation12/Baystation12/labels{/name}","releases_url":"https://api.github.com/repos/Baystation12/Baystation12/releases{/id}","created_at":"2011-11-05T16:12:41Z","updated_at":"2015-04-02T07:27:53Z","pushed_at":"2015-04-02T09:25:47Z","git_url":"git://github.com/Baystation12/Baystation12.git","ssh_url":"git@github.com:Baystation12/Baystation12.git","clone_url":"https://github.com/Baystation12/Baystation12.git","svn_url":"https://github.com/Baystation12/Baystation12","homepage":"http://baystation12.net/","size":1365275,"stargazers_count":183,"watchers_count":183,"language":"DM","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":716,"mirror_url":null,"open_issues_count":201,"forks":716,"open_issues":201,"watchers":183,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Baystation12/Baystation12/pulls/8707"},"html":{"href":"https://github.com/Baystation12/Baystation12/pull/8707"},"issue":{"href":"https://api.github.com/repos/Baystation12/Baystation12/issues/8707"},"comments":{"href":"https://api.github.com/repos/Baystation12/Baystation12/issues/8707/comments"},"review_comments":{"href":"https://api.github.com/repos/Baystation12/Baystation12/pulls/8707/comments"},"review_comment":{"href":"https://api.github.com/repos/Baystation12/Baystation12/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Baystation12/Baystation12/pulls/8707/commits"},"statuses":{"href":"https://api.github.com/repos/Baystation12/Baystation12/statuses/6d71ca9af90b4cae12cba1a2933e5ececb2bd9d4"}}}}