{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2836","repository_url":"https://api.github.com/repos/Microsoft/ChakraCore","labels_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2836/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2836/comments","events_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2836/events","html_url":"https://github.com/Microsoft/ChakraCore/issues/2836","id":221704181,"number":2836,"title":" [proposed label: Question] Is the native C stack really known to the garbage collection system?","user":{"login":"markt-","id":6332969,"avatar_url":"https://avatars3.githubusercontent.com/u/6332969?v=3","gravatar_id":"","url":"https://api.github.com/users/markt-","html_url":"https://github.com/markt-","followers_url":"https://api.github.com/users/markt-/followers","following_url":"https://api.github.com/users/markt-/following{/other_user}","gists_url":"https://api.github.com/users/markt-/gists{/gist_id}","starred_url":"https://api.github.com/users/markt-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markt-/subscriptions","organizations_url":"https://api.github.com/users/markt-/orgs","repos_url":"https://api.github.com/users/markt-/repos","events_url":"https://api.github.com/users/markt-/events{/privacy}","received_events_url":"https://api.github.com/users/markt-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-13T23:02:43Z","updated_at":"2017-04-14T21:46:04Z","closed_at":null,"body":"The JSRT overview appears to say that the garbage collector may clean up JsRef's that are on the native application's heap if JsAddRef has not been called for them, but it is not clear to me if the stack that is being referred to is only the javascript runtime stack, or if it includes local variables that are created in C.    If it does not include the native stack, then it would seem that JsAddRef and JsRelease bookkeeping needs to be done for any C variables containing a JsRef if one does not want the garbage collector to clean them before the function exits.  This does, of course, run somewhat counter to what the documentatoin appears to say about the garbage collector not trying to  clean up references on the stack, but I cannot see how it would be able to identify references that were native C local variables.  If local C variables are in fact safe from being clearned, how does the garbage collector know not to touch them?\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/comments/294242824","html_url":"https://github.com/Microsoft/ChakraCore/issues/2836#issuecomment-294242824","issue_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2836","id":294242824,"user":{"login":"kfarnung","id":931192,"avatar_url":"https://avatars1.githubusercontent.com/u/931192?v=3","gravatar_id":"","url":"https://api.github.com/users/kfarnung","html_url":"https://github.com/kfarnung","followers_url":"https://api.github.com/users/kfarnung/followers","following_url":"https://api.github.com/users/kfarnung/following{/other_user}","gists_url":"https://api.github.com/users/kfarnung/gists{/gist_id}","starred_url":"https://api.github.com/users/kfarnung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfarnung/subscriptions","organizations_url":"https://api.github.com/users/kfarnung/orgs","repos_url":"https://api.github.com/users/kfarnung/repos","events_url":"https://api.github.com/users/kfarnung/events{/privacy}","received_events_url":"https://api.github.com/users/kfarnung/received_events","type":"User","site_admin":false},"created_at":"2017-04-14T21:46:04Z","updated_at":"2017-04-14T21:46:04Z","body":"I'm by no means the expert, but here's my understanding of the GC.  Stack pointers are scanned in `Recycler::ScanStack()` by finding the stack bounds for the thread context and then scanning that segment of memory for valid pointers to GC memory.  Any objects pointed to on the stack are then marked and maintained.\r\n\r\nhttps://github.com/Microsoft/ChakraCore/blob/master/lib/Common/Memory/Recycler.cpp#L1678\r\n\r\n@digitalinfinity @curtisman Can you confirm my understanding?"}}
{"actor":{"display_login":"kfarnung"}}