{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/14047","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/14047/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/14047/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/14047/events","html_url":"https://github.com/dotnet/corefx/issues/14047","id":191920462,"number":14047,"title":"Add RuntimeHelpers.IsReferenceOrContainsReferences<T>()","user":{"login":"jkotas","id":6668460,"avatar_url":"https://avatars.githubusercontent.com/u/6668460?v=3","gravatar_id":"","url":"https://api.github.com/users/jkotas","html_url":"https://github.com/jkotas","followers_url":"https://api.github.com/users/jkotas/followers","following_url":"https://api.github.com/users/jkotas/following{/other_user}","gists_url":"https://api.github.com/users/jkotas/gists{/gist_id}","starred_url":"https://api.github.com/users/jkotas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkotas/subscriptions","organizations_url":"https://api.github.com/users/jkotas/orgs","repos_url":"https://api.github.com/users/jkotas/repos","events_url":"https://api.github.com/users/jkotas/events{/privacy}","received_events_url":"https://api.github.com/users/jkotas/received_events","type":"User","site_admin":false},"labels":[{"id":165998434,"url":"https://api.github.com/repos/dotnet/corefx/labels/api-ready-for-review","name":"api-ready-for-review","color":"5319e7","default":false},{"id":174276033,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Runtime","name":"area-System.Runtime","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/5","html_url":"https://github.com/dotnet/corefx/milestones/Future","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/5/labels","id":1328080,"number":5,"title":"Future","description":"Milestone tracking the issues triaged for an unspecified future release","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":670,"closed_issues":437,"state":"open","created_at":"2015-09-29T00:25:45Z","updated_at":"2016-11-29T20:19:46Z","due_on":null,"closed_at":null},"comments":20,"created_at":"2016-11-28T05:06:54Z","updated_at":"2016-11-29T21:16:45Z","closed_at":null,"body":"```c#\r\nnamespace System.Runtime.CompilerServices\r\n{\r\n    public static class RuntimeHelpers\r\n    {\r\n        public static bool IsReferenceOrContainsReferences<T>();\r\n    }\r\n}\r\n```\r\n\r\nThis method will return true if T is reference type; or if T is value type that contains reference type fields. false otherwise.\r\n\r\nThis API is intended to be used primarily for optimizations:\r\n\r\n- Generic List calls Array.Clear on its underlying array in the implementation of Clear, RemoveAll, RemoveRange methods today. It has to do so because the generic argument can contain references which must be freed for GC. It can be skipped using this method when not required.\r\n\r\n- Algorithms for memory manipulations can have optimized paths for memory blocks without GC references. This method can be used to determine whether the optimized path is safe to use. `Span<T>` is example of such memory manipulation algorithms. It going to use this API internally in its implementation.\r\n\r\nThis API addition was tracked by CoreCLR issue. https://github.com/dotnet/coreclr/issues/1135 has a lot of discussion about the right name for this API. The alternative names considered include `ContainsReferences`, `IsGCPointerOrContainsGCPointers`."},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/263701380","html_url":"https://github.com/dotnet/corefx/issues/14047#issuecomment-263701380","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/14047","id":263701380,"user":{"login":"masonwheeler","id":7650031,"avatar_url":"https://avatars.githubusercontent.com/u/7650031?v=3","gravatar_id":"","url":"https://api.github.com/users/masonwheeler","html_url":"https://github.com/masonwheeler","followers_url":"https://api.github.com/users/masonwheeler/followers","following_url":"https://api.github.com/users/masonwheeler/following{/other_user}","gists_url":"https://api.github.com/users/masonwheeler/gists{/gist_id}","starred_url":"https://api.github.com/users/masonwheeler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masonwheeler/subscriptions","organizations_url":"https://api.github.com/users/masonwheeler/orgs","repos_url":"https://api.github.com/users/masonwheeler/repos","events_url":"https://api.github.com/users/masonwheeler/events{/privacy}","received_events_url":"https://api.github.com/users/masonwheeler/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T21:16:45Z","updated_at":"2016-11-29T21:16:45Z","body":"I've heard it said there are only two hard problems in computer science: Cache invalidation, naming things well, and off-by-one errors..."}}
{"actor":{"display_login":"masonwheeler"}}