{"action":"opened","number":13,"pull_request":{"url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/pulls/13","id":131976456,"html_url":"https://github.com/polyfractal/bounded-spsc-queue/pull/13","diff_url":"https://github.com/polyfractal/bounded-spsc-queue/pull/13.diff","patch_url":"https://github.com/polyfractal/bounded-spsc-queue/pull/13.patch","issue_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/issues/13","number":13,"state":"open","locked":false,"title":"Fix Buffer's cache line padding on 32-bit targets","user":{"login":"nanotech","id":34699,"avatar_url":"https://avatars2.githubusercontent.com/u/34699?v=4","gravatar_id":"","url":"https://api.github.com/users/nanotech","html_url":"https://github.com/nanotech","followers_url":"https://api.github.com/users/nanotech/followers","following_url":"https://api.github.com/users/nanotech/following{/other_user}","gists_url":"https://api.github.com/users/nanotech/gists{/gist_id}","starred_url":"https://api.github.com/users/nanotech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanotech/subscriptions","organizations_url":"https://api.github.com/users/nanotech/orgs","repos_url":"https://api.github.com/users/nanotech/repos","events_url":"https://api.github.com/users/nanotech/events{/privacy}","received_events_url":"https://api.github.com/users/nanotech/received_events","type":"User","site_admin":false},"body":"Please correct me if I'm wrong, but it looks to me that the cache line padding in Buffer is too large on 32-bit targets.\r\n\r\nOn 64-bit targets, the sizes are:\r\n\r\n    buffer            8 bytes\r\n    capacity          8 bytes\r\n    allocated_size    8 bytes\r\n    _padding1         40 bytes = 8 * (8 - 3)\r\n                      --------\r\n                      64 bytes\r\n\r\n    head/tail         8 bytes\r\n    shadow_tail/head  8 bytes\r\n    _padding2/3       48 bytes = 8 * (8 - 2)\r\n                      --------\r\n                      64 bytes\r\n\r\nOn 32-bit however,\r\n\r\n    buffer            4 bytes\r\n    capacity          4 bytes\r\n    allocated_size    4 bytes\r\n    _padding1         104 bytes = 8 * (16 - 3)\r\n                      --------\r\n                      116 bytes\r\n\r\n    head/tail         4 bytes\r\n    shadow_tail/head  4 bytes\r\n    _padding2/3       112 bytes = 8 * (16 - 2)\r\n                      --------\r\n                      120 bytes\r\n\r\nReplacing the `u64` padding with `usize` padding makes the math work out, and seems like how `cacheline_pad!` was intended to work:\r\n\r\n    buffer            4 bytes\r\n    capacity          4 bytes\r\n    allocated_size    4 bytes\r\n    _padding1         52 bytes = 4 * (16 - 3)\r\n                      --------\r\n                      64 bytes\r\n\r\n    head/tail         4 bytes\r\n    shadow_tail/head  4 bytes\r\n    _padding2/3       56 bytes = 4 * (16 - 2)\r\n                      --------\r\n                      64 bytes\r\n","created_at":"2017-07-24T06:00:04Z","updated_at":"2017-07-24T06:00:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/pulls/13/commits","review_comments_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/pulls/13/comments","review_comment_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/pulls/comments{/number}","comments_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/issues/13/comments","statuses_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/statuses/675fe0ff724b84a8b91226a0549a127760fc9189","head":{"label":"nanotech:cacheline32","ref":"cacheline32","sha":"675fe0ff724b84a8b91226a0549a127760fc9189","user":{"login":"nanotech","id":34699,"avatar_url":"https://avatars2.githubusercontent.com/u/34699?v=4","gravatar_id":"","url":"https://api.github.com/users/nanotech","html_url":"https://github.com/nanotech","followers_url":"https://api.github.com/users/nanotech/followers","following_url":"https://api.github.com/users/nanotech/following{/other_user}","gists_url":"https://api.github.com/users/nanotech/gists{/gist_id}","starred_url":"https://api.github.com/users/nanotech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanotech/subscriptions","organizations_url":"https://api.github.com/users/nanotech/orgs","repos_url":"https://api.github.com/users/nanotech/repos","events_url":"https://api.github.com/users/nanotech/events{/privacy}","received_events_url":"https://api.github.com/users/nanotech/received_events","type":"User","site_admin":false},"repo":{"id":98151044,"name":"bounded-spsc-queue","full_name":"nanotech/bounded-spsc-queue","owner":{"login":"nanotech","id":34699,"avatar_url":"https://avatars2.githubusercontent.com/u/34699?v=4","gravatar_id":"","url":"https://api.github.com/users/nanotech","html_url":"https://github.com/nanotech","followers_url":"https://api.github.com/users/nanotech/followers","following_url":"https://api.github.com/users/nanotech/following{/other_user}","gists_url":"https://api.github.com/users/nanotech/gists{/gist_id}","starred_url":"https://api.github.com/users/nanotech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nanotech/subscriptions","organizations_url":"https://api.github.com/users/nanotech/orgs","repos_url":"https://api.github.com/users/nanotech/repos","events_url":"https://api.github.com/users/nanotech/events{/privacy}","received_events_url":"https://api.github.com/users/nanotech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nanotech/bounded-spsc-queue","description":"A Bounded SPSC queue for Rust","fork":true,"url":"https://api.github.com/repos/nanotech/bounded-spsc-queue","forks_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/forks","keys_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/teams","hooks_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/hooks","issue_events_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/issues/events{/number}","events_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/events","assignees_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/assignees{/user}","branches_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/branches{/branch}","tags_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/tags","blobs_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/git/refs{/sha}","trees_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/statuses/{sha}","languages_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/languages","stargazers_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/stargazers","contributors_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/contributors","subscribers_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/subscribers","subscription_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/subscription","commits_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/commits{/sha}","git_commits_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/git/commits{/sha}","comments_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/comments{/number}","issue_comment_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/issues/comments{/number}","contents_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/contents/{+path}","compare_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/merges","archive_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/downloads","issues_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/issues{/number}","pulls_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/pulls{/number}","milestones_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/milestones{/number}","notifications_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/labels{/name}","releases_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/releases{/id}","deployments_url":"https://api.github.com/repos/nanotech/bounded-spsc-queue/deployments","created_at":"2017-07-24T05:09:37Z","updated_at":"2017-07-24T05:09:38Z","pushed_at":"2017-07-24T05:55:12Z","git_url":"git://github.com/nanotech/bounded-spsc-queue.git","ssh_url":"git@github.com:nanotech/bounded-spsc-queue.git","clone_url":"https://github.com/nanotech/bounded-spsc-queue.git","svn_url":"https://github.com/nanotech/bounded-spsc-queue","homepage":null,"size":1078,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"polyfractal:master","ref":"master","sha":"db596cc282a0d0bb214567d5a3e9f95723bc7149","user":{"login":"polyfractal","id":1224228,"avatar_url":"https://avatars1.githubusercontent.com/u/1224228?v=4","gravatar_id":"","url":"https://api.github.com/users/polyfractal","html_url":"https://github.com/polyfractal","followers_url":"https://api.github.com/users/polyfractal/followers","following_url":"https://api.github.com/users/polyfractal/following{/other_user}","gists_url":"https://api.github.com/users/polyfractal/gists{/gist_id}","starred_url":"https://api.github.com/users/polyfractal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polyfractal/subscriptions","organizations_url":"https://api.github.com/users/polyfractal/orgs","repos_url":"https://api.github.com/users/polyfractal/repos","events_url":"https://api.github.com/users/polyfractal/events{/privacy}","received_events_url":"https://api.github.com/users/polyfractal/received_events","type":"User","site_admin":false},"repo":{"id":34768079,"name":"bounded-spsc-queue","full_name":"polyfractal/bounded-spsc-queue","owner":{"login":"polyfractal","id":1224228,"avatar_url":"https://avatars1.githubusercontent.com/u/1224228?v=4","gravatar_id":"","url":"https://api.github.com/users/polyfractal","html_url":"https://github.com/polyfractal","followers_url":"https://api.github.com/users/polyfractal/followers","following_url":"https://api.github.com/users/polyfractal/following{/other_user}","gists_url":"https://api.github.com/users/polyfractal/gists{/gist_id}","starred_url":"https://api.github.com/users/polyfractal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polyfractal/subscriptions","organizations_url":"https://api.github.com/users/polyfractal/orgs","repos_url":"https://api.github.com/users/polyfractal/repos","events_url":"https://api.github.com/users/polyfractal/events{/privacy}","received_events_url":"https://api.github.com/users/polyfractal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/polyfractal/bounded-spsc-queue","description":"A Bounded SPSC queue for Rust","fork":false,"url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue","forks_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/forks","keys_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/keys{/key_id}","collaborators_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/teams","hooks_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/hooks","issue_events_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/issues/events{/number}","events_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/events","assignees_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/assignees{/user}","branches_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/branches{/branch}","tags_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/tags","blobs_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/git/refs{/sha}","trees_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/git/trees{/sha}","statuses_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/statuses/{sha}","languages_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/languages","stargazers_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/stargazers","contributors_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/contributors","subscribers_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/subscribers","subscription_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/subscription","commits_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/commits{/sha}","git_commits_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/git/commits{/sha}","comments_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/comments{/number}","issue_comment_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/issues/comments{/number}","contents_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/contents/{+path}","compare_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/compare/{base}...{head}","merges_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/merges","archive_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/downloads","issues_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/issues{/number}","pulls_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/pulls{/number}","milestones_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/milestones{/number}","notifications_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/labels{/name}","releases_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/releases{/id}","deployments_url":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/deployments","created_at":"2015-04-29T02:32:57Z","updated_at":"2017-07-23T20:16:09Z","pushed_at":"2017-07-20T12:23:28Z","git_url":"git://github.com/polyfractal/bounded-spsc-queue.git","ssh_url":"git@github.com:polyfractal/bounded-spsc-queue.git","clone_url":"https://github.com/polyfractal/bounded-spsc-queue.git","svn_url":"https://github.com/polyfractal/bounded-spsc-queue","homepage":null,"size":1078,"stargazers_count":69,"watchers_count":69,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":17,"mirror_url":null,"open_issues_count":4,"forks":17,"open_issues":4,"watchers":69,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/pulls/13"},"html":{"href":"https://github.com/polyfractal/bounded-spsc-queue/pull/13"},"issue":{"href":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/issues/13"},"comments":{"href":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/polyfractal/bounded-spsc-queue/statuses/675fe0ff724b84a8b91226a0549a127760fc9189"}},"merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":2,"additions":11,"deletions":5,"changed_files":1}}
{"actor":{"display_login":"nanotech"}}