{"action":"created","issue":{"url":"https://api.github.com/repos/m-labs/smoltcp/issues/187","repository_url":"https://api.github.com/repos/m-labs/smoltcp","labels_url":"https://api.github.com/repos/m-labs/smoltcp/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/m-labs/smoltcp/issues/187/comments","events_url":"https://api.github.com/repos/m-labs/smoltcp/issues/187/events","html_url":"https://github.com/m-labs/smoltcp/pull/187","id":312693629,"number":187,"title":"Make the RingBuffer contiguous memory optimization work.","user":{"login":"astro","id":12923,"avatar_url":"https://avatars0.githubusercontent.com/u/12923?v=4","gravatar_id":"","url":"https://api.github.com/users/astro","html_url":"https://github.com/astro","followers_url":"https://api.github.com/users/astro/followers","following_url":"https://api.github.com/users/astro/following{/other_user}","gists_url":"https://api.github.com/users/astro/gists{/gist_id}","starred_url":"https://api.github.com/users/astro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astro/subscriptions","organizations_url":"https://api.github.com/users/astro/orgs","repos_url":"https://api.github.com/users/astro/repos","events_url":"https://api.github.com/users/astro/events{/privacy}","received_events_url":"https://api.github.com/users/astro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-09T21:26:19Z","updated_at":"2018-04-12T01:53:15Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/m-labs/smoltcp/pulls/187","html_url":"https://github.com/m-labs/smoltcp/pull/187","diff_url":"https://github.com/m-labs/smoltcp/pull/187.diff","patch_url":"https://github.com/m-labs/smoltcp/pull/187.patch"},"body":"I've studied the code for a while and wondered why there is a check for `capacity > 0` at this location. `capacity` doesn't change. I believe `self.length` was actually intended here.\r\n\r\nIn the RawSocket use by #186 that's needed otherwise `PacketBuffer` tends to get a stuck `payload_ring` (`length=0` but `read_at` near `capacity`)."},"comment":{"url":"https://api.github.com/repos/m-labs/smoltcp/issues/comments/380649432","html_url":"https://github.com/m-labs/smoltcp/pull/187#issuecomment-380649432","issue_url":"https://api.github.com/repos/m-labs/smoltcp/issues/187","id":380649432,"user":{"login":"whitequark","id":54771,"avatar_url":"https://avatars1.githubusercontent.com/u/54771?v=4","gravatar_id":"","url":"https://api.github.com/users/whitequark","html_url":"https://github.com/whitequark","followers_url":"https://api.github.com/users/whitequark/followers","following_url":"https://api.github.com/users/whitequark/following{/other_user}","gists_url":"https://api.github.com/users/whitequark/gists{/gist_id}","starred_url":"https://api.github.com/users/whitequark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitequark/subscriptions","organizations_url":"https://api.github.com/users/whitequark/orgs","repos_url":"https://api.github.com/users/whitequark/repos","events_url":"https://api.github.com/users/whitequark/events{/privacy}","received_events_url":"https://api.github.com/users/whitequark/received_events","type":"User","site_admin":false},"created_at":"2018-04-12T01:53:15Z","updated_at":"2018-04-12T01:53:15Z","author_association":"OWNER","body":"It seems we have two separate things at work here:\r\n  1. A possible bug: \"I've studied the code for a while and wondered why there is a check for capacity > 0 at this location. capacity doesn't change. I believe self.length was actually intended here.\"\r\n  2. An optimization (?): \"In the RawSocket use by #186 that's needed otherwise PacketBuffer tends to get a stuck payload_ring (length=0 but read_at near capacity).\"\r\n\r\n@astro, can you please provide separate test cases for (1) and (2)? If the check is genuinely dead, then let's first remove it, and then separately examine the optimization (2); I don't fully understand why it is necessary yet."}}
{"actor":{"display_login":"whitequark"}}