{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/10141","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/10141/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/10141/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/10141/events","html_url":"https://github.com/dotnet/coreclr/issues/10141","id":213680256,"number":10141,"title":"Wrong comment about GC pinning bit in object.h","user":{"login":"303248153","id":16222094,"avatar_url":"https://avatars1.githubusercontent.com/u/16222094?v=3","gravatar_id":"","url":"https://api.github.com/users/303248153","html_url":"https://github.com/303248153","followers_url":"https://api.github.com/users/303248153/followers","following_url":"https://api.github.com/users/303248153/following{/other_user}","gists_url":"https://api.github.com/users/303248153/gists{/gist_id}","starred_url":"https://api.github.com/users/303248153/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/303248153/subscriptions","organizations_url":"https://api.github.com/users/303248153/orgs","repos_url":"https://api.github.com/users/303248153/repos","events_url":"https://api.github.com/users/303248153/events{/privacy}","received_events_url":"https://api.github.com/users/303248153/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-13T05:57:17Z","updated_at":"2017-03-13T05:57:17Z","closed_at":null,"body":"I found this comment in https://github.com/dotnet/coreclr/blob/master/src/vm/object.h\r\n```\r\n// lose GC marking bit and the pinning bit\r\n// A method table pointer should always be aligned.  During GC we set the least \r\n// significant bit for marked objects and we set the second to least significant\r\n// bit for pinned objects.  So if we want the actual MT pointer during a GC\r\n// we must zero out the lowest 2 bits.\r\n```\r\nI think it's wrong, GC pinning bit actually stored in object header\r\n\r\n``` c++\r\nvoid SetPinned()\r\n{\r\n    assert (!(gc_heap::settings.concurrent));\r\n    GetHeader()->SetGCBit();\r\n}\r\n\r\nvoid SetGCBit() { m_uSyncBlockValue |= BIT_SBLK_GC_RESERVE; }\r\n```\r\nAnd I verified in lldb\r\n![1](https://cloud.githubusercontent.com/assets/16222094/23843132/ab715616-07f4-11e7-84c5-8e618f14318a.jpg)\r\n\r\nAnd no code is touching `m_pMethTab & 2`, am I right and should this comment be fixed?"}}
{"actor":{"display_login":"303248153"}}