{"action":"created","comment":{"url":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/comments/196504919","pull_request_review_id":130069584,"id":196504919,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjUwNDkxOQ==","diff_hunk":"@@ -415,23 +417,72 @@ int openblas_get_num_threads(void) {\n #endif\n }\n \n-struct release_t {\n-  void *address;\n-  void (*func)(struct release_t *);\n-  long attr;\n-};\n-\n int hugetlb_allocated = 0;\n \n #if defined(OS_WINDOWS)\n #define THREAD_LOCAL __declspec(thread)\n-#define UNLIKELY_TO_BE_ZERO(x) (x)\n+#define LIKELY_ONE(x) (x)\n #else\n #define THREAD_LOCAL __thread\n-#define UNLIKELY_TO_BE_ZERO(x) (__builtin_expect(x, 0))\n+#define LIKELY_ONE(x) (__builtin_expect(x, 1))\n+#endif\n+\n+struct alloc_t {\n+  int used;\n+  int attr;\n+  void (*func)(struct alloc_t *);\n+  /* Pad to 64-byte alignment */\n+#ifdef __64BIT__\n+  char pad[48];\n+#else\n+  char pad[52];\n+#endif\n+};\n+\n+static const int allocation_block_size = BUFFER_SIZE + sizeof(struct alloc_t);\n+\n+/* TLS is supported from clang 2.8, gcc 4.1, MSVC 2005, and XCode 8 */\n+#if ((defined(__clang__) && (__clang_major__ > 2) ||               \\\n+      ((__clang_minor__ == 2) || (__clang_minor__ == 8))) ||       \\\n+     (!defined(__clang__) && defined(__GNUC__) &&                  \\\n+      (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))) || \\\n+     (defined(_MSC_VER) && _MSC_VER >= 1400)) &&                   \\\n+    (!defined(__apple_build_version__) || __apple_build_version__ >= 8000042)\n+#define HAS_COMPILER_TLS\n+#endif\n+\n+/* Android NDK's before 12 did not support TLS */\n+#if defined(__ANDROID__) && defined(__clang__)\n+#if __has_include(<android/ndk-version.h>)\n+#include <android/ndk-version.h>\n+#endif\n+#if defined(__ANDROID__) && defined(__clang__) && defined(__NDK_MAJOR__) && \\\n+    defined(__NDK_MINOR__) &&                                               \\\n+    ((__NDK_MAJOR__ < 12) || ((__NDK_MAJOR__ == 12) && (__NDK_MINOR__ < 1)))\n+#undef HAS_COMPILER_TLS\n+#endif\n+#endif\n+\n+/* Holds pointers to allocated memory */\n+#if defined(SMP) && !defined(USE_OPENMP)\n+#define MAX_ALLOCATING_THREADS MAX_CPU_NUMBER * 2 * MAX_PARALLEL_NUMBER","path":"driver/others/memory.c","position":78,"original_position":78,"commit_id":"e9d6864ef12cc0ea80a86c507d340f4ff7fdf7e6","original_commit_id":"e9d6864ef12cc0ea80a86c507d340f4ff7fdf7e6","user":{"login":"sandwichmaker","id":1712133,"node_id":"MDQ6VXNlcjE3MTIxMzM=","avatar_url":"https://avatars2.githubusercontent.com/u/1712133?v=4","gravatar_id":"","url":"https://api.github.com/users/sandwichmaker","html_url":"https://github.com/sandwichmaker","followers_url":"https://api.github.com/users/sandwichmaker/followers","following_url":"https://api.github.com/users/sandwichmaker/following{/other_user}","gists_url":"https://api.github.com/users/sandwichmaker/gists{/gist_id}","starred_url":"https://api.github.com/users/sandwichmaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandwichmaker/subscriptions","organizations_url":"https://api.github.com/users/sandwichmaker/orgs","repos_url":"https://api.github.com/users/sandwichmaker/repos","events_url":"https://api.github.com/users/sandwichmaker/events{/privacy}","received_events_url":"https://api.github.com/users/sandwichmaker/received_events","type":"User","site_admin":false},"body":"what is the logic for this number?","created_at":"2018-06-19T17:02:18Z","updated_at":"2018-06-19T17:16:53Z","html_url":"https://github.com/xianyi/OpenBLAS/pull/1625#discussion_r196504919","pull_request_url":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/1625","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/comments/196504919"},"html":{"href":"https://github.com/xianyi/OpenBLAS/pull/1625#discussion_r196504919"},"pull_request":{"href":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/1625"}}},"pull_request":{"url":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/1625","id":195580818,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1NTgwODE4","html_url":"https://github.com/xianyi/OpenBLAS/pull/1625","diff_url":"https://github.com/xianyi/OpenBLAS/pull/1625.diff","patch_url":"https://github.com/xianyi/OpenBLAS/pull/1625.patch","issue_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/1625","number":1625,"state":"open","locked":false,"title":"Further improvements to memory.c.","user":{"login":"oon3m0oo","id":11841654,"node_id":"MDQ6VXNlcjExODQxNjU0","avatar_url":"https://avatars0.githubusercontent.com/u/11841654?v=4","gravatar_id":"","url":"https://api.github.com/users/oon3m0oo","html_url":"https://github.com/oon3m0oo","followers_url":"https://api.github.com/users/oon3m0oo/followers","following_url":"https://api.github.com/users/oon3m0oo/following{/other_user}","gists_url":"https://api.github.com/users/oon3m0oo/gists{/gist_id}","starred_url":"https://api.github.com/users/oon3m0oo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oon3m0oo/subscriptions","organizations_url":"https://api.github.com/users/oon3m0oo/orgs","repos_url":"https://api.github.com/users/oon3m0oo/repos","events_url":"https://api.github.com/users/oon3m0oo/events{/privacy}","received_events_url":"https://api.github.com/users/oon3m0oo/received_events","type":"User","site_admin":false},"body":"- Compiler TLS is now used only used when the compiler supports it\r\n- If compiler TLS is unsupported, we use platform-specific TLS\r\n- Only one variable (an index) is now in TLS\r\n- We only access TLS once per alloc, and never when freeing\r\n- Allocation / release info is now stored within the allocation itself, by\r\n  over-allocating; this saves having external structures do the bookkeeping, and\r\n  reduces some of the redundant data that was being stored (such as addresses)\r\n- We never hit the alloc lock when not using SMP or when using OpenMP (that was\r\n  my fault)\r\n- Now that there are fewer tracking structures I think this is a bit easier to\r\n  read than before","created_at":"2018-06-18T16:28:04Z","updated_at":"2018-06-19T17:16:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b651c08fb380704e4b0f6cd27b53f224ba3caad0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/1625/commits","review_comments_url":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/1625/comments","review_comment_url":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/1625/comments","statuses_url":"https://api.github.com/repos/xianyi/OpenBLAS/statuses/e9d6864ef12cc0ea80a86c507d340f4ff7fdf7e6","head":{"label":"oon3m0oo:develop","ref":"develop","sha":"e9d6864ef12cc0ea80a86c507d340f4ff7fdf7e6","user":{"login":"oon3m0oo","id":11841654,"node_id":"MDQ6VXNlcjExODQxNjU0","avatar_url":"https://avatars0.githubusercontent.com/u/11841654?v=4","gravatar_id":"","url":"https://api.github.com/users/oon3m0oo","html_url":"https://github.com/oon3m0oo","followers_url":"https://api.github.com/users/oon3m0oo/followers","following_url":"https://api.github.com/users/oon3m0oo/following{/other_user}","gists_url":"https://api.github.com/users/oon3m0oo/gists{/gist_id}","starred_url":"https://api.github.com/users/oon3m0oo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oon3m0oo/subscriptions","organizations_url":"https://api.github.com/users/oon3m0oo/orgs","repos_url":"https://api.github.com/users/oon3m0oo/repos","events_url":"https://api.github.com/users/oon3m0oo/events{/privacy}","received_events_url":"https://api.github.com/users/oon3m0oo/received_events","type":"User","site_admin":false},"repo":{"id":136484679,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY0ODQ2Nzk=","name":"OpenBLAS","full_name":"oon3m0oo/OpenBLAS","owner":{"login":"oon3m0oo","id":11841654,"node_id":"MDQ6VXNlcjExODQxNjU0","avatar_url":"https://avatars0.githubusercontent.com/u/11841654?v=4","gravatar_id":"","url":"https://api.github.com/users/oon3m0oo","html_url":"https://github.com/oon3m0oo","followers_url":"https://api.github.com/users/oon3m0oo/followers","following_url":"https://api.github.com/users/oon3m0oo/following{/other_user}","gists_url":"https://api.github.com/users/oon3m0oo/gists{/gist_id}","starred_url":"https://api.github.com/users/oon3m0oo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oon3m0oo/subscriptions","organizations_url":"https://api.github.com/users/oon3m0oo/orgs","repos_url":"https://api.github.com/users/oon3m0oo/repos","events_url":"https://api.github.com/users/oon3m0oo/events{/privacy}","received_events_url":"https://api.github.com/users/oon3m0oo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oon3m0oo/OpenBLAS","description":"OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. ","fork":true,"url":"https://api.github.com/repos/oon3m0oo/OpenBLAS","forks_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/forks","keys_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/teams","hooks_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/hooks","issue_events_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/issues/events{/number}","events_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/events","assignees_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/assignees{/user}","branches_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/branches{/branch}","tags_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/tags","blobs_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/git/refs{/sha}","trees_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/statuses/{sha}","languages_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/languages","stargazers_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/stargazers","contributors_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/contributors","subscribers_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/subscribers","subscription_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/subscription","commits_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/commits{/sha}","git_commits_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/git/commits{/sha}","comments_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/comments{/number}","issue_comment_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/issues/comments{/number}","contents_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/contents/{+path}","compare_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/merges","archive_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/downloads","issues_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/issues{/number}","pulls_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/pulls{/number}","milestones_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/milestones{/number}","notifications_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/labels{/name}","releases_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/releases{/id}","deployments_url":"https://api.github.com/repos/oon3m0oo/OpenBLAS/deployments","created_at":"2018-06-07T13:53:39Z","updated_at":"2018-06-19T16:31:58Z","pushed_at":"2018-06-19T16:31:56Z","git_url":"git://github.com/oon3m0oo/OpenBLAS.git","ssh_url":"git@github.com:oon3m0oo/OpenBLAS.git","clone_url":"https://github.com/oon3m0oo/OpenBLAS.git","svn_url":"https://github.com/oon3m0oo/OpenBLAS","homepage":"http://www.openblas.net","size":22557,"stargazers_count":0,"watchers_count":0,"language":"Fortran","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"xianyi:develop","ref":"develop","sha":"5a6a2bed9aff0ba8a18651d5514d029c8cae336a","user":{"login":"xianyi","id":371600,"node_id":"MDQ6VXNlcjM3MTYwMA==","avatar_url":"https://avatars1.githubusercontent.com/u/371600?v=4","gravatar_id":"","url":"https://api.github.com/users/xianyi","html_url":"https://github.com/xianyi","followers_url":"https://api.github.com/users/xianyi/followers","following_url":"https://api.github.com/users/xianyi/following{/other_user}","gists_url":"https://api.github.com/users/xianyi/gists{/gist_id}","starred_url":"https://api.github.com/users/xianyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xianyi/subscriptions","organizations_url":"https://api.github.com/users/xianyi/orgs","repos_url":"https://api.github.com/users/xianyi/repos","events_url":"https://api.github.com/users/xianyi/events{/privacy}","received_events_url":"https://api.github.com/users/xianyi/received_events","type":"User","site_admin":false},"repo":{"id":1286805,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg2ODA1","name":"OpenBLAS","full_name":"xianyi/OpenBLAS","owner":{"login":"xianyi","id":371600,"node_id":"MDQ6VXNlcjM3MTYwMA==","avatar_url":"https://avatars1.githubusercontent.com/u/371600?v=4","gravatar_id":"","url":"https://api.github.com/users/xianyi","html_url":"https://github.com/xianyi","followers_url":"https://api.github.com/users/xianyi/followers","following_url":"https://api.github.com/users/xianyi/following{/other_user}","gists_url":"https://api.github.com/users/xianyi/gists{/gist_id}","starred_url":"https://api.github.com/users/xianyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xianyi/subscriptions","organizations_url":"https://api.github.com/users/xianyi/orgs","repos_url":"https://api.github.com/users/xianyi/repos","events_url":"https://api.github.com/users/xianyi/events{/privacy}","received_events_url":"https://api.github.com/users/xianyi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xianyi/OpenBLAS","description":"OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. ","fork":false,"url":"https://api.github.com/repos/xianyi/OpenBLAS","forks_url":"https://api.github.com/repos/xianyi/OpenBLAS/forks","keys_url":"https://api.github.com/repos/xianyi/OpenBLAS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xianyi/OpenBLAS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xianyi/OpenBLAS/teams","hooks_url":"https://api.github.com/repos/xianyi/OpenBLAS/hooks","issue_events_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/events{/number}","events_url":"https://api.github.com/repos/xianyi/OpenBLAS/events","assignees_url":"https://api.github.com/repos/xianyi/OpenBLAS/assignees{/user}","branches_url":"https://api.github.com/repos/xianyi/OpenBLAS/branches{/branch}","tags_url":"https://api.github.com/repos/xianyi/OpenBLAS/tags","blobs_url":"https://api.github.com/repos/xianyi/OpenBLAS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xianyi/OpenBLAS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xianyi/OpenBLAS/git/refs{/sha}","trees_url":"https://api.github.com/repos/xianyi/OpenBLAS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xianyi/OpenBLAS/statuses/{sha}","languages_url":"https://api.github.com/repos/xianyi/OpenBLAS/languages","stargazers_url":"https://api.github.com/repos/xianyi/OpenBLAS/stargazers","contributors_url":"https://api.github.com/repos/xianyi/OpenBLAS/contributors","subscribers_url":"https://api.github.com/repos/xianyi/OpenBLAS/subscribers","subscription_url":"https://api.github.com/repos/xianyi/OpenBLAS/subscription","commits_url":"https://api.github.com/repos/xianyi/OpenBLAS/commits{/sha}","git_commits_url":"https://api.github.com/repos/xianyi/OpenBLAS/git/commits{/sha}","comments_url":"https://api.github.com/repos/xianyi/OpenBLAS/comments{/number}","issue_comment_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/comments{/number}","contents_url":"https://api.github.com/repos/xianyi/OpenBLAS/contents/{+path}","compare_url":"https://api.github.com/repos/xianyi/OpenBLAS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xianyi/OpenBLAS/merges","archive_url":"https://api.github.com/repos/xianyi/OpenBLAS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xianyi/OpenBLAS/downloads","issues_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues{/number}","pulls_url":"https://api.github.com/repos/xianyi/OpenBLAS/pulls{/number}","milestones_url":"https://api.github.com/repos/xianyi/OpenBLAS/milestones{/number}","notifications_url":"https://api.github.com/repos/xianyi/OpenBLAS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xianyi/OpenBLAS/labels{/name}","releases_url":"https://api.github.com/repos/xianyi/OpenBLAS/releases{/id}","deployments_url":"https://api.github.com/repos/xianyi/OpenBLAS/deployments","created_at":"2011-01-24T06:34:44Z","updated_at":"2018-06-19T02:43:55Z","pushed_at":"2018-06-19T16:31:57Z","git_url":"git://github.com/xianyi/OpenBLAS.git","ssh_url":"git@github.com:xianyi/OpenBLAS.git","clone_url":"https://github.com/xianyi/OpenBLAS.git","svn_url":"https://github.com/xianyi/OpenBLAS","homepage":"http://www.openblas.net","size":22575,"stargazers_count":2095,"watchers_count":2095,"language":"Fortran","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":594,"mirror_url":null,"archived":false,"open_issues_count":112,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":594,"open_issues":112,"watchers":2095,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/1625"},"html":{"href":"https://github.com/xianyi/OpenBLAS/pull/1625"},"issue":{"href":"https://api.github.com/repos/xianyi/OpenBLAS/issues/1625"},"comments":{"href":"https://api.github.com/repos/xianyi/OpenBLAS/issues/1625/comments"},"review_comments":{"href":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/1625/comments"},"review_comment":{"href":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xianyi/OpenBLAS/pulls/1625/commits"},"statuses":{"href":"https://api.github.com/repos/xianyi/OpenBLAS/statuses/e9d6864ef12cc0ea80a86c507d340f4ff7fdf7e6"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sandwichmaker"}}