{"action":"created","comment":{"url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/comments/68197558","id":68197558,"diff_hunk":"@@ -1955,19 +1983,22 @@ class HugeHeaplet : public Heaplet\n \n     virtual void noteReleased(const void *ptr)\n     {\n+        //NORE: See comment on FixedSizeHeaplet::noteReleased() regarding the memory order operands\n+\n         //If rowCount == 1 then this must be the last reference - avoid a locked operation.\n         //rowCount is not used once the heaplet is known to be freed, so no need to ensure rowCount=0\n-        if (atomic_read(&rowCount) == 1 || atomic_dec_and_test(&rowCount))\n+        if (rowCount.load(std::memory_order_relaxed) == 1 || rowCount.fetch_sub(1, std::memory_order_release) == 1)","path":"roxie/roxiemem/roxiemem.cpp","position":463,"original_position":284,"commit_id":"4c9c5b5416c4f01ce7dff9e23a753fecbb00d5f0","original_commit_id":"a29ad9028a031fdbfd30be19e34a6433f2bdcf20","user":{"login":"ghalliday","id":902490,"avatar_url":"https://avatars.githubusercontent.com/u/902490?v=3","gravatar_id":"","url":"https://api.github.com/users/ghalliday","html_url":"https://github.com/ghalliday","followers_url":"https://api.github.com/users/ghalliday/followers","following_url":"https://api.github.com/users/ghalliday/following{/other_user}","gists_url":"https://api.github.com/users/ghalliday/gists{/gist_id}","starred_url":"https://api.github.com/users/ghalliday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghalliday/subscriptions","organizations_url":"https://api.github.com/users/ghalliday/orgs","repos_url":"https://api.github.com/users/ghalliday/repos","events_url":"https://api.github.com/users/ghalliday/events{/privacy}","received_events_url":"https://api.github.com/users/ghalliday/received_events","type":"User","site_admin":false},"body":"I think it is correct.  dec_and_test decrements the value, and then returns it.  fetch_sub gets the value and then subtracts it.  The c++ standard has no sub_fetch which would be the closest equivalent.\r\n\r\nPrevious definition:\r\nstatic __inline__ bool atomic_inc_and_test(atomic_t *v)\r\n{\r\n    return (__sync_add_and_fetch(&v->counter,1)==0);\r\n}\r\n","created_at":"2016-06-23T08:52:12Z","updated_at":"2016-06-23T08:52:12Z","html_url":"https://github.com/hpcc-systems/HPCC-Platform/pull/8656#discussion_r68197558","pull_request_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8656","_links":{"self":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/comments/68197558"},"html":{"href":"https://github.com/hpcc-systems/HPCC-Platform/pull/8656#discussion_r68197558"},"pull_request":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8656"}}},"pull_request":{"url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8656","id":70024624,"html_url":"https://github.com/hpcc-systems/HPCC-Platform/pull/8656","diff_url":"https://github.com/hpcc-systems/HPCC-Platform/pull/8656.diff","patch_url":"https://github.com/hpcc-systems/HPCC-Platform/pull/8656.patch","issue_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/8656","number":8656,"state":"open","locked":false,"title":"HPCC-15360 Switch memory manager over to use std::atomic","user":{"login":"ghalliday","id":902490,"avatar_url":"https://avatars.githubusercontent.com/u/902490?v=3","gravatar_id":"","url":"https://api.github.com/users/ghalliday","html_url":"https://github.com/ghalliday","followers_url":"https://api.github.com/users/ghalliday/followers","following_url":"https://api.github.com/users/ghalliday/following{/other_user}","gists_url":"https://api.github.com/users/ghalliday/gists{/gist_id}","starred_url":"https://api.github.com/users/ghalliday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghalliday/subscriptions","organizations_url":"https://api.github.com/users/ghalliday/orgs","repos_url":"https://api.github.com/users/ghalliday/repos","events_url":"https://api.github.com/users/ghalliday/events{/privacy}","received_events_url":"https://api.github.com/users/ghalliday/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-13T16:39:37Z","updated_at":"2016-06-23T08:52:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4e4fc46f07d826dc8fadc651dea7e1b6c23a012","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8656/commits","review_comments_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8656/comments","review_comment_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/8656/comments","statuses_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/statuses/4c9c5b5416c4f01ce7dff9e23a753fecbb00d5f0","head":{"label":"ghalliday:issue15360b","ref":"issue15360b","sha":"4c9c5b5416c4f01ce7dff9e23a753fecbb00d5f0","user":{"login":"ghalliday","id":902490,"avatar_url":"https://avatars.githubusercontent.com/u/902490?v=3","gravatar_id":"","url":"https://api.github.com/users/ghalliday","html_url":"https://github.com/ghalliday","followers_url":"https://api.github.com/users/ghalliday/followers","following_url":"https://api.github.com/users/ghalliday/following{/other_user}","gists_url":"https://api.github.com/users/ghalliday/gists{/gist_id}","starred_url":"https://api.github.com/users/ghalliday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghalliday/subscriptions","organizations_url":"https://api.github.com/users/ghalliday/orgs","repos_url":"https://api.github.com/users/ghalliday/repos","events_url":"https://api.github.com/users/ghalliday/events{/privacy}","received_events_url":"https://api.github.com/users/ghalliday/received_events","type":"User","site_admin":false},"repo":{"id":2034867,"name":"HPCC-Platform","full_name":"ghalliday/HPCC-Platform","owner":{"login":"ghalliday","id":902490,"avatar_url":"https://avatars.githubusercontent.com/u/902490?v=3","gravatar_id":"","url":"https://api.github.com/users/ghalliday","html_url":"https://github.com/ghalliday","followers_url":"https://api.github.com/users/ghalliday/followers","following_url":"https://api.github.com/users/ghalliday/following{/other_user}","gists_url":"https://api.github.com/users/ghalliday/gists{/gist_id}","starred_url":"https://api.github.com/users/ghalliday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghalliday/subscriptions","organizations_url":"https://api.github.com/users/ghalliday/orgs","repos_url":"https://api.github.com/users/ghalliday/repos","events_url":"https://api.github.com/users/ghalliday/events{/privacy}","received_events_url":"https://api.github.com/users/ghalliday/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ghalliday/HPCC-Platform","description":"HPCC Systems big data solution, community edition","fork":true,"url":"https://api.github.com/repos/ghalliday/HPCC-Platform","forks_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/forks","keys_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/teams","hooks_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/hooks","issue_events_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/issues/events{/number}","events_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/events","assignees_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/assignees{/user}","branches_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/branches{/branch}","tags_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/tags","blobs_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/statuses/{sha}","languages_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/languages","stargazers_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/stargazers","contributors_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/contributors","subscribers_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/subscribers","subscription_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/subscription","commits_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/contents/{+path}","compare_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/merges","archive_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/downloads","issues_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/issues{/number}","pulls_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/pulls{/number}","milestones_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/milestones{/number}","notifications_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/labels{/name}","releases_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/releases{/id}","deployments_url":"https://api.github.com/repos/ghalliday/HPCC-Platform/deployments","created_at":"2011-07-12T08:05:04Z","updated_at":"2015-05-08T12:57:14Z","pushed_at":"2016-06-23T08:36:51Z","git_url":"git://github.com/ghalliday/HPCC-Platform.git","ssh_url":"git@github.com:ghalliday/HPCC-Platform.git","clone_url":"https://github.com/ghalliday/HPCC-Platform.git","svn_url":"https://github.com/ghalliday/HPCC-Platform","homepage":"www.hpccsystems.com","size":171114,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"hpcc-systems:master","ref":"master","sha":"2df3b6d6c25d58d0e145976397fefcf37ed83189","user":{"login":"hpcc-systems","id":900867,"avatar_url":"https://avatars.githubusercontent.com/u/900867?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcc-systems","html_url":"https://github.com/hpcc-systems","followers_url":"https://api.github.com/users/hpcc-systems/followers","following_url":"https://api.github.com/users/hpcc-systems/following{/other_user}","gists_url":"https://api.github.com/users/hpcc-systems/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcc-systems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcc-systems/subscriptions","organizations_url":"https://api.github.com/users/hpcc-systems/orgs","repos_url":"https://api.github.com/users/hpcc-systems/repos","events_url":"https://api.github.com/users/hpcc-systems/events{/privacy}","received_events_url":"https://api.github.com/users/hpcc-systems/received_events","type":"Organization","site_admin":false},"repo":{"id":2030681,"name":"HPCC-Platform","full_name":"hpcc-systems/HPCC-Platform","owner":{"login":"hpcc-systems","id":900867,"avatar_url":"https://avatars.githubusercontent.com/u/900867?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcc-systems","html_url":"https://github.com/hpcc-systems","followers_url":"https://api.github.com/users/hpcc-systems/followers","following_url":"https://api.github.com/users/hpcc-systems/following{/other_user}","gists_url":"https://api.github.com/users/hpcc-systems/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcc-systems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcc-systems/subscriptions","organizations_url":"https://api.github.com/users/hpcc-systems/orgs","repos_url":"https://api.github.com/users/hpcc-systems/repos","events_url":"https://api.github.com/users/hpcc-systems/events{/privacy}","received_events_url":"https://api.github.com/users/hpcc-systems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpcc-systems/HPCC-Platform","description":"HPCC Systems (High Performance Computing Cluster) is an open source, massive parallel-processing computing platform for big data processing and analytics.","fork":false,"url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform","forks_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/forks","keys_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/teams","hooks_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/hooks","issue_events_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/events{/number}","events_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/events","assignees_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/assignees{/user}","branches_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/branches{/branch}","tags_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/tags","blobs_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/statuses/{sha}","languages_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/languages","stargazers_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/stargazers","contributors_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/contributors","subscribers_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/subscribers","subscription_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/subscription","commits_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/contents/{+path}","compare_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/merges","archive_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/downloads","issues_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues{/number}","pulls_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls{/number}","milestones_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/milestones{/number}","notifications_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/labels{/name}","releases_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/releases{/id}","deployments_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/deployments","created_at":"2011-07-11T14:29:51Z","updated_at":"2016-06-17T19:46:06Z","pushed_at":"2016-06-23T08:37:45Z","git_url":"git://github.com/hpcc-systems/HPCC-Platform.git","ssh_url":"git@github.com:hpcc-systems/HPCC-Platform.git","clone_url":"https://github.com/hpcc-systems/HPCC-Platform.git","svn_url":"https://github.com/hpcc-systems/HPCC-Platform","homepage":"http://hpccsystems.com","size":198100,"stargazers_count":281,"watchers_count":281,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":151,"mirror_url":null,"open_issues_count":423,"forks":151,"open_issues":423,"watchers":281,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8656"},"html":{"href":"https://github.com/hpcc-systems/HPCC-Platform/pull/8656"},"issue":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/8656"},"comments":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/8656/comments"},"review_comments":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8656/comments"},"review_comment":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8656/commits"},"statuses":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/statuses/4c9c5b5416c4f01ce7dff9e23a753fecbb00d5f0"}}}}
{"actor":{"display_login":"ghalliday"}}