{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/14396","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/14396/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/14396/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/14396/events","html_url":"https://github.com/dotnet/corefx/pull/14396","id":194740868,"number":14396,"title":"[WIP] S.M.Span<T>: Add Clear()/Fill(T value)","user":{"login":"nietras","id":10798831,"avatar_url":"https://avatars.githubusercontent.com/u/10798831?v=3","gravatar_id":"","url":"https://api.github.com/users/nietras","html_url":"https://github.com/nietras","followers_url":"https://api.github.com/users/nietras/followers","following_url":"https://api.github.com/users/nietras/following{/other_user}","gists_url":"https://api.github.com/users/nietras/gists{/gist_id}","starred_url":"https://api.github.com/users/nietras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nietras/subscriptions","organizations_url":"https://api.github.com/users/nietras/orgs","repos_url":"https://api.github.com/users/nietras/repos","events_url":"https://api.github.com/users/nietras/events{/privacy}","received_events_url":"https://api.github.com/users/nietras/received_events","type":"User","site_admin":false},"labels":[{"id":284076100,"url":"https://api.github.com/repos/dotnet/corefx/labels/*%20NO%20MERGE%20*","name":"* NO MERGE *","color":"e11d21","default":false},{"id":174276033,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Runtime","name":"area-System.Runtime","color":"d4c5f9","default":false},{"id":197706871,"url":"https://api.github.com/repos/dotnet/corefx/labels/cla-already-signed","name":"cla-already-signed","color":"009800","default":false}],"state":"open","locked":false,"assignee":{"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},"assignees":[{"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},{"login":"nietras","id":10798831,"avatar_url":"https://avatars.githubusercontent.com/u/10798831?v=3","gravatar_id":"","url":"https://api.github.com/users/nietras","html_url":"https://github.com/nietras","followers_url":"https://api.github.com/users/nietras/followers","following_url":"https://api.github.com/users/nietras/following{/other_user}","gists_url":"https://api.github.com/users/nietras/gists{/gist_id}","starred_url":"https://api.github.com/users/nietras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nietras/subscriptions","organizations_url":"https://api.github.com/users/nietras/orgs","repos_url":"https://api.github.com/users/nietras/repos","events_url":"https://api.github.com/users/nietras/events{/privacy}","received_events_url":"https://api.github.com/users/nietras/received_events","type":"User","site_admin":false}],"milestone":null,"comments":30,"created_at":"2016-12-10T03:10:05Z","updated_at":"2016-12-15T20:51:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/14396","html_url":"https://github.com/dotnet/corefx/pull/14396","diff_url":"https://github.com/dotnet/corefx/pull/14396.diff","patch_url":"https://github.com/dotnet/corefx/pull/14396.patch"},"body":"Just to get the ball rolling, here is naive Clear/Fill implementations for `Span<T>` as per approved API proposals https://github.com/dotnet/corefx/issues/13915 and https://github.com/dotnet/corefx/issues/14189 i.e.:\r\n```csharp\r\npublic class Span<T>\r\n{\r\n     public void Clear();\r\n     public void Fill(T value);\r\n}\r\n```\r\n@jkotas I will try to update this PR over time and hope you can give some feedback until we reach a point where more people can be added for review. If that is ok with you?\r\n\r\nI would like to start minimally with implementation, and instead focus on ensuring complete tests are in place and ideally perf tests so we can establish a baseline. From that we can move on with optimizations.\r\n\r\nSo first question, is what tests should be added? As I see we need at least three different scenarios:\r\n * Value type without references i.e. `int` (already there)\r\n * Reference type i.e. `string`\r\n * Value type with references i.e. custom `struct`\r\n\r\nAdditionally, there needs to be tests that cover alignment issues etc. I assume.\r\n\r\ncc: @karelz\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/267440477","html_url":"https://github.com/dotnet/corefx/pull/14396#issuecomment-267440477","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/14396","id":267440477,"user":{"login":"nietras","id":10798831,"avatar_url":"https://avatars.githubusercontent.com/u/10798831?v=3","gravatar_id":"","url":"https://api.github.com/users/nietras","html_url":"https://github.com/nietras","followers_url":"https://api.github.com/users/nietras/followers","following_url":"https://api.github.com/users/nietras/following{/other_user}","gists_url":"https://api.github.com/users/nietras/gists{/gist_id}","starred_url":"https://api.github.com/users/nietras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nietras/subscriptions","organizations_url":"https://api.github.com/users/nietras/orgs","repos_url":"https://api.github.com/users/nietras/repos","events_url":"https://api.github.com/users/nietras/events{/privacy}","received_events_url":"https://api.github.com/users/nietras/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T20:51:19Z","updated_at":"2016-12-15T20:51:19Z","body":"Haven't tried this before :) Couldn't find any guide on it... So add something like:\r\n```\r\nMembersMustExist : Member 'System.Security.Cryptography.CngAlgorithm.ECDiffieHellman.get()' does not exist in the implementation but it does exist in the contract.\r\n```\r\nto `https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/ApiCompatBaseline.txt`? so it looks like:\r\n```\r\nCompat issues with assembly System.Memory:\r\nMembersMustExist : Member 'System.Span<T>.GetItem(System.Int32)' does not exist in the implementation but it does exist in the contract.\r\nMembersMustExist : Member 'System.Span<T>.Clear()' does not exist in the implementation but it does exist in the contract.\r\nMembersMustExist : Member 'System.Span<T>.Fill(T)' does not exist in the implementation but it does exist in the contract.\r\nTotal Issues: 1\r\n```\r\n"}}
{"actor":{"display_login":"nietras"}}