{"action":"created","comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments/115515214","pull_request_review_id":37059282,"id":115515214,"diff_hunk":"@@ -493,10 +493,15 @@ const qio_file_functions_ptr_t hdfs_function_struct_ptr = &hdfs_function_struct;\n static\n char* get_locale_name(char *loc)\n {\n+  char* ret = NULL;\n   const char *keys = \".\"; // We lop off the .us.cray...\n-  int i = strcspn (loc, keys);\n-\n-  return strndup(loc, i);\n+  int len = strcspn (loc, keys);\n+  ret = (char*) qio_malloc(len+1);\n+  if (ret) {\n+    ret[len] = '\\0';\n+    qio_memcpy(ret, loc, len);","path":"runtime/src/qio/auxFilesys/hdfs/qio_plugin_hdfs.c","position":13,"original_position":13,"commit_id":"b8d55d11469b83d0bfde6b151dc23fd39cae85c1","original_commit_id":"b18f0d471d2cd3762edd5cbd8e7264fbbe55450e","user":{"login":"mppf","id":3653132,"avatar_url":"https://avatars0.githubusercontent.com/u/3653132?v=3","gravatar_id":"","url":"https://api.github.com/users/mppf","html_url":"https://github.com/mppf","followers_url":"https://api.github.com/users/mppf/followers","following_url":"https://api.github.com/users/mppf/following{/other_user}","gists_url":"https://api.github.com/users/mppf/gists{/gist_id}","starred_url":"https://api.github.com/users/mppf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppf/subscriptions","organizations_url":"https://api.github.com/users/mppf/orgs","repos_url":"https://api.github.com/users/mppf/repos","events_url":"https://api.github.com/users/mppf/events{/privacy}","received_events_url":"https://api.github.com/users/mppf/received_events","type":"User","site_admin":false},"body":"Looks good. I'd tend to write the '\\0' after the memcpy (easier to optimize), but that's a minor issue & performance is not critical here.","created_at":"2017-05-09T15:09:45Z","updated_at":"2017-05-09T15:09:45Z","html_url":"https://github.com/chapel-lang/chapel/pull/6197#discussion_r115515214","pull_request_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/6197","_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments/115515214"},"html":{"href":"https://github.com/chapel-lang/chapel/pull/6197#discussion_r115515214"},"pull_request":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/6197"}}},"pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/6197","id":119588117,"html_url":"https://github.com/chapel-lang/chapel/pull/6197","diff_url":"https://github.com/chapel-lang/chapel/pull/6197.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/6197.patch","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/6197","number":6197,"state":"open","locked":false,"title":"Replace all runtime calls to the system allocator with wrapper functions","user":{"login":"ronawho","id":1588337,"avatar_url":"https://avatars2.githubusercontent.com/u/1588337?v=3","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"body":"Add sys_{malloc, calloc, realloc, memalign, free} wrappers and use them instead\r\nof directly calling the system allocator. This allows the lookForBadAlloc\r\nscript (added in #6163) to run cleanly.\r\n\r\nGenerally speaking, we want our runtime to call the chapel allocator, instead\r\nof the system one. This can offer better performance, and more importantly for\r\ncases where the heap is registered, we usually want allocations in the runtime\r\nto be registered as well. It also allows us to track memory allocations via\r\n'chplmemtrack'. There are a few special cases where we need to call the system\r\nallocator (memory layer not initialized yet, want non-registered memory.) Those\r\nfew cases now call the sys_ wrappers instead of directly calling the system\r\nallocator.\r\n\r\nHistorically, we've enforced our \"don't use the system allocator\" policy with\r\n'chpl-mem-warning-macros.h/chpl-mem-no-warning-macros.h/', which does something\r\nlike \"#define malloc dont_use_malloc_use_chpl_mem_allocMany_instead\". This\r\napproach has a couple unfortunate downsides:\r\n - It prevents the token \"malloc\" from being used, not just calls the function\r\n   so we have to turn off the warnings in more places than ideal\r\n - It's caused portability issues (especially on cygwin). We define malloc\r\n   before including system headers in many files, and so if a system header\r\n   uses the token malloc, we fail to build. e.g.\r\n    - https://github.com/chapel-lang/chapel/commit/95272793b4\r\n    - https://github.com/chapel-lang/chapel/commit/59e3f5e5bb\r\n\r\nThis patch allows the ./util/devel/lookForBadAlloc script to pass. My intention\r\nis to use that script to check that we're not mistakenly calling the system\r\nallocator and retire chpl-mem-warning-macros.h.\r\n","created_at":"2017-05-09T05:53:38Z","updated_at":"2017-05-09T15:09:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cd7d307a0b3002c0cfe42990dfaae69a49e627b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/6197/commits","review_comments_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/6197/comments","review_comment_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/6197/comments","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/b8d55d11469b83d0bfde6b151dc23fd39cae85c1","head":{"label":"ronawho:add-sys-alloc-wrappers","ref":"add-sys-alloc-wrappers","sha":"b8d55d11469b83d0bfde6b151dc23fd39cae85c1","user":{"login":"ronawho","id":1588337,"avatar_url":"https://avatars2.githubusercontent.com/u/1588337?v=3","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"repo":{"id":21908970,"name":"chapel","full_name":"ronawho/chapel","owner":{"login":"ronawho","id":1588337,"avatar_url":"https://avatars2.githubusercontent.com/u/1588337?v=3","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ronawho/chapel","description":"a Productive Parallel Programming Language","fork":true,"url":"https://api.github.com/repos/ronawho/chapel","forks_url":"https://api.github.com/repos/ronawho/chapel/forks","keys_url":"https://api.github.com/repos/ronawho/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ronawho/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ronawho/chapel/teams","hooks_url":"https://api.github.com/repos/ronawho/chapel/hooks","issue_events_url":"https://api.github.com/repos/ronawho/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/ronawho/chapel/events","assignees_url":"https://api.github.com/repos/ronawho/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/ronawho/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/ronawho/chapel/tags","blobs_url":"https://api.github.com/repos/ronawho/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ronawho/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ronawho/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ronawho/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ronawho/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/ronawho/chapel/languages","stargazers_url":"https://api.github.com/repos/ronawho/chapel/stargazers","contributors_url":"https://api.github.com/repos/ronawho/chapel/contributors","subscribers_url":"https://api.github.com/repos/ronawho/chapel/subscribers","subscription_url":"https://api.github.com/repos/ronawho/chapel/subscription","commits_url":"https://api.github.com/repos/ronawho/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ronawho/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ronawho/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ronawho/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/ronawho/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/ronawho/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ronawho/chapel/merges","archive_url":"https://api.github.com/repos/ronawho/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ronawho/chapel/downloads","issues_url":"https://api.github.com/repos/ronawho/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/ronawho/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/ronawho/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/ronawho/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ronawho/chapel/labels{/name}","releases_url":"https://api.github.com/repos/ronawho/chapel/releases{/id}","deployments_url":"https://api.github.com/repos/ronawho/chapel/deployments","created_at":"2014-07-16T16:46:31Z","updated_at":"2016-01-15T06:49:12Z","pushed_at":"2017-05-09T06:56:43Z","git_url":"git://github.com/ronawho/chapel.git","ssh_url":"git@github.com:ronawho/chapel.git","clone_url":"https://github.com/ronawho/chapel.git","svn_url":"https://github.com/ronawho/chapel","homepage":"http://chapel.cray.com/","size":401958,"stargazers_count":2,"watchers_count":2,"language":"Chapel","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"chapel-lang:master","ref":"master","sha":"77036d262624b2b58b118db25b260c7653dd3ec7","user":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars1.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":21663285,"name":"chapel","full_name":"chapel-lang/chapel","owner":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars1.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chapel-lang/chapel","description":"a Productive Parallel Programming Language","fork":false,"url":"https://api.github.com/repos/chapel-lang/chapel","forks_url":"https://api.github.com/repos/chapel-lang/chapel/forks","keys_url":"https://api.github.com/repos/chapel-lang/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chapel-lang/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chapel-lang/chapel/teams","hooks_url":"https://api.github.com/repos/chapel-lang/chapel/hooks","issue_events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/chapel-lang/chapel/events","assignees_url":"https://api.github.com/repos/chapel-lang/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/chapel-lang/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/chapel-lang/chapel/tags","blobs_url":"https://api.github.com/repos/chapel-lang/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chapel-lang/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chapel-lang/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/chapel-lang/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/chapel-lang/chapel/languages","stargazers_url":"https://api.github.com/repos/chapel-lang/chapel/stargazers","contributors_url":"https://api.github.com/repos/chapel-lang/chapel/contributors","subscribers_url":"https://api.github.com/repos/chapel-lang/chapel/subscribers","subscription_url":"https://api.github.com/repos/chapel-lang/chapel/subscription","commits_url":"https://api.github.com/repos/chapel-lang/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/chapel-lang/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/chapel-lang/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/chapel-lang/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chapel-lang/chapel/merges","archive_url":"https://api.github.com/repos/chapel-lang/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chapel-lang/chapel/downloads","issues_url":"https://api.github.com/repos/chapel-lang/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/chapel-lang/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/chapel-lang/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/chapel-lang/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chapel-lang/chapel/labels{/name}","releases_url":"https://api.github.com/repos/chapel-lang/chapel/releases{/id}","deployments_url":"https://api.github.com/repos/chapel-lang/chapel/deployments","created_at":"2014-07-09T18:15:54Z","updated_at":"2017-05-09T12:17:23Z","pushed_at":"2017-05-09T14:55:01Z","git_url":"git://github.com/chapel-lang/chapel.git","ssh_url":"git@github.com:chapel-lang/chapel.git","clone_url":"https://github.com/chapel-lang/chapel.git","svn_url":"https://github.com/chapel-lang/chapel","homepage":"http://chapel.cray.com/","size":412385,"stargazers_count":440,"watchers_count":440,"language":"Chapel","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":142,"mirror_url":null,"open_issues_count":275,"forks":142,"open_issues":275,"watchers":440,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/6197"},"html":{"href":"https://github.com/chapel-lang/chapel/pull/6197"},"issue":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/6197"},"comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/6197/comments"},"review_comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/6197/comments"},"review_comment":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/6197/commits"},"statuses":{"href":"https://api.github.com/repos/chapel-lang/chapel/statuses/b8d55d11469b83d0bfde6b151dc23fd39cae85c1"}}}}
{"actor":{"display_login":"mppf"}}