{"action":"created","comment":{"url":"https://api.github.com/repos/ros2/rcutils/pulls/comments/194574052","pull_request_review_id":127772952,"id":194574052,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDU3NDA1Mg==","diff_hunk":"@@ -14,56 +14,64 @@\n \n #include <gtest/gtest.h>\n \n-#include <inttypes.h>\n-\n #include <chrono>\n+#include <cinttypes>\n #include <thread>\n \n+#include \"osrf_testing_tools_cpp/memory_tools/memory_tools.hpp\"\n+\n #include \"rcutils/error_handling.h\"\n #include \"rcutils/time.h\"\n \n-#include \"./memory_tools/memory_tools.hpp\"\n+using osrf_testing_tools_cpp::memory_tools::disable_monitoring_in_all_threads;\n+using osrf_testing_tools_cpp::memory_tools::enable_monitoring_in_all_threads;\n+using osrf_testing_tools_cpp::memory_tools::expect_no_calloc_begin;\n+using osrf_testing_tools_cpp::memory_tools::expect_no_calloc_end;\n+using osrf_testing_tools_cpp::memory_tools::expect_no_free_begin;\n+using osrf_testing_tools_cpp::memory_tools::expect_no_free_end;\n+using osrf_testing_tools_cpp::memory_tools::expect_no_malloc_begin;\n+using osrf_testing_tools_cpp::memory_tools::expect_no_malloc_end;\n+using osrf_testing_tools_cpp::memory_tools::expect_no_realloc_begin;\n+using osrf_testing_tools_cpp::memory_tools::expect_no_realloc_end;\n+using osrf_testing_tools_cpp::memory_tools::MemoryToolsService;\n+using osrf_testing_tools_cpp::memory_tools::on_unexpected_calloc;\n+using osrf_testing_tools_cpp::memory_tools::on_unexpected_free;\n+using osrf_testing_tools_cpp::memory_tools::on_unexpected_malloc;\n+using osrf_testing_tools_cpp::memory_tools::on_unexpected_realloc;\n \n class TestTimeFixture : public ::testing::Test\n {\n public:\n   void SetUp()\n   {\n-    set_on_unexpected_malloc_callback([]() {ASSERT_FALSE(true) << \"UNEXPECTED MALLOC\";});\n-    set_on_unexpected_realloc_callback([]() {ASSERT_FALSE(true) << \"UNEXPECTED REALLOC\";});\n-    set_on_unexpected_free_callback([]() {ASSERT_FALSE(true) << \"UNEXPECTED FREE\";});\n-    start_memory_checking();\n+    osrf_testing_tools_cpp::memory_tools::initialize();\n+    on_unexpected_malloc([]() {FAIL() << \"UNEXPECTED MALLOC\";});","path":"test/test_time.cpp","position":33,"original_position":42,"commit_id":"1d10bec73846ff9bc8a39fbbaad4efe90f17d899","original_commit_id":"a82372089f3404cf19e4043a5caf71d9b6dddbac","user":{"login":"dhood","id":5618076,"node_id":"MDQ6VXNlcjU2MTgwNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/5618076?v=4","gravatar_id":"","url":"https://api.github.com/users/dhood","html_url":"https://github.com/dhood","followers_url":"https://api.github.com/users/dhood/followers","following_url":"https://api.github.com/users/dhood/following{/other_user}","gists_url":"https://api.github.com/users/dhood/gists{/gist_id}","starred_url":"https://api.github.com/users/dhood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhood/subscriptions","organizations_url":"https://api.github.com/users/dhood/orgs","repos_url":"https://api.github.com/users/dhood/repos","events_url":"https://api.github.com/users/dhood/events{/privacy}","received_events_url":"https://api.github.com/users/dhood/received_events","type":"User","site_admin":false},"body":"Yeah, I don't mean that the function as it's named is exceptionally misleading, just that on first glance I expected that line to be doing _checking_ for unexpected mallocs as opposed to setting a callback, whereas with the other naming it was clearer. If that's a naming pattern used by other languages e.g. jquery as you mentioned, then that's fine now that it's been changed","created_at":"2018-06-11T23:07:51Z","updated_at":"2018-06-11T23:07:51Z","html_url":"https://github.com/ros2/rcutils/pull/101#discussion_r194574052","pull_request_url":"https://api.github.com/repos/ros2/rcutils/pulls/101","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ros2/rcutils/pulls/comments/194574052"},"html":{"href":"https://github.com/ros2/rcutils/pull/101#discussion_r194574052"},"pull_request":{"href":"https://api.github.com/repos/ros2/rcutils/pulls/101"}},"in_reply_to_id":194553947},"pull_request":{"url":"https://api.github.com/repos/ros2/rcutils/pulls/101","id":185155123,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg1MTU1MTIz","html_url":"https://github.com/ros2/rcutils/pull/101","diff_url":"https://github.com/ros2/rcutils/pull/101.diff","patch_url":"https://github.com/ros2/rcutils/pull/101.patch","issue_url":"https://api.github.com/repos/ros2/rcutils/issues/101","number":101,"state":"open","locked":false,"title":"update to use new memory_tools from osrf_testing_tools_cpp","user":{"login":"wjwwood","id":100427,"node_id":"MDQ6VXNlcjEwMDQyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/100427?v=4","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false},"body":"This is just a pr to use the new memory tools that I refactored out of this package and `rcl` too. After this will come a pr to make use of the memory tools in this repository more and fix memory allocation issues.","created_at":"2018-05-01T10:28:08Z","updated_at":"2018-06-11T23:07:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"54831e51b4f31412ed49da152368397a4670a685","assignee":{"login":"wjwwood","id":100427,"node_id":"MDQ6VXNlcjEwMDQyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/100427?v=4","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false},"assignees":[{"login":"wjwwood","id":100427,"node_id":"MDQ6VXNlcjEwMDQyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/100427?v=4","gravatar_id":"","url":"https://api.github.com/users/wjwwood","html_url":"https://github.com/wjwwood","followers_url":"https://api.github.com/users/wjwwood/followers","following_url":"https://api.github.com/users/wjwwood/following{/other_user}","gists_url":"https://api.github.com/users/wjwwood/gists{/gist_id}","starred_url":"https://api.github.com/users/wjwwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjwwood/subscriptions","organizations_url":"https://api.github.com/users/wjwwood/orgs","repos_url":"https://api.github.com/users/wjwwood/repos","events_url":"https://api.github.com/users/wjwwood/events{/privacy}","received_events_url":"https://api.github.com/users/wjwwood/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":536059365,"node_id":"MDU6TGFiZWw1MzYwNTkzNjU=","url":"https://api.github.com/repos/ros2/rcutils/labels/enhancement","name":"enhancement","color":"a2eeef","default":true},{"id":562391539,"node_id":"MDU6TGFiZWw1NjIzOTE1Mzk=","url":"https://api.github.com/repos/ros2/rcutils/labels/in%20progress","name":"in progress","color":"fad8c7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ros2/rcutils/pulls/101/commits","review_comments_url":"https://api.github.com/repos/ros2/rcutils/pulls/101/comments","review_comment_url":"https://api.github.com/repos/ros2/rcutils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros2/rcutils/issues/101/comments","statuses_url":"https://api.github.com/repos/ros2/rcutils/statuses/1d10bec73846ff9bc8a39fbbaad4efe90f17d899","head":{"label":"ros2:use_osrf_testing_tools_cpp","ref":"use_osrf_testing_tools_cpp","sha":"1d10bec73846ff9bc8a39fbbaad4efe90f17d899","user":{"login":"ros2","id":3979232,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NzkyMzI=","avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":81483797,"node_id":"MDEwOlJlcG9zaXRvcnk4MTQ4Mzc5Nw==","name":"rcutils","full_name":"ros2/rcutils","owner":{"login":"ros2","id":3979232,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NzkyMzI=","avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/rcutils","description":"Common C functions and data structures used in ROS 2","fork":false,"url":"https://api.github.com/repos/ros2/rcutils","forks_url":"https://api.github.com/repos/ros2/rcutils/forks","keys_url":"https://api.github.com/repos/ros2/rcutils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rcutils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rcutils/teams","hooks_url":"https://api.github.com/repos/ros2/rcutils/hooks","issue_events_url":"https://api.github.com/repos/ros2/rcutils/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rcutils/events","assignees_url":"https://api.github.com/repos/ros2/rcutils/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rcutils/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rcutils/tags","blobs_url":"https://api.github.com/repos/ros2/rcutils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rcutils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rcutils/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rcutils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rcutils/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rcutils/languages","stargazers_url":"https://api.github.com/repos/ros2/rcutils/stargazers","contributors_url":"https://api.github.com/repos/ros2/rcutils/contributors","subscribers_url":"https://api.github.com/repos/ros2/rcutils/subscribers","subscription_url":"https://api.github.com/repos/ros2/rcutils/subscription","commits_url":"https://api.github.com/repos/ros2/rcutils/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rcutils/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rcutils/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rcutils/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rcutils/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rcutils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rcutils/merges","archive_url":"https://api.github.com/repos/ros2/rcutils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rcutils/downloads","issues_url":"https://api.github.com/repos/ros2/rcutils/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rcutils/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rcutils/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rcutils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rcutils/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rcutils/releases{/id}","deployments_url":"https://api.github.com/repos/ros2/rcutils/deployments","created_at":"2017-02-09T18:56:35Z","updated_at":"2018-06-08T00:12:34Z","pushed_at":"2018-06-11T23:07:35Z","git_url":"git://github.com/ros2/rcutils.git","ssh_url":"git@github.com:ros2/rcutils.git","clone_url":"https://github.com/ros2/rcutils.git","svn_url":"https://github.com/ros2/rcutils","homepage":"","size":308,"stargazers_count":8,"watchers_count":8,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":12,"open_issues":10,"watchers":8,"default_branch":"master"}},"base":{"label":"ros2:master","ref":"master","sha":"9092a2581aba9be2a44f90a646e75f8d129ccdfa","user":{"login":"ros2","id":3979232,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NzkyMzI=","avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"repo":{"id":81483797,"node_id":"MDEwOlJlcG9zaXRvcnk4MTQ4Mzc5Nw==","name":"rcutils","full_name":"ros2/rcutils","owner":{"login":"ros2","id":3979232,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5NzkyMzI=","avatar_url":"https://avatars1.githubusercontent.com/u/3979232?v=4","gravatar_id":"","url":"https://api.github.com/users/ros2","html_url":"https://github.com/ros2","followers_url":"https://api.github.com/users/ros2/followers","following_url":"https://api.github.com/users/ros2/following{/other_user}","gists_url":"https://api.github.com/users/ros2/gists{/gist_id}","starred_url":"https://api.github.com/users/ros2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros2/subscriptions","organizations_url":"https://api.github.com/users/ros2/orgs","repos_url":"https://api.github.com/users/ros2/repos","events_url":"https://api.github.com/users/ros2/events{/privacy}","received_events_url":"https://api.github.com/users/ros2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros2/rcutils","description":"Common C functions and data structures used in ROS 2","fork":false,"url":"https://api.github.com/repos/ros2/rcutils","forks_url":"https://api.github.com/repos/ros2/rcutils/forks","keys_url":"https://api.github.com/repos/ros2/rcutils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros2/rcutils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros2/rcutils/teams","hooks_url":"https://api.github.com/repos/ros2/rcutils/hooks","issue_events_url":"https://api.github.com/repos/ros2/rcutils/issues/events{/number}","events_url":"https://api.github.com/repos/ros2/rcutils/events","assignees_url":"https://api.github.com/repos/ros2/rcutils/assignees{/user}","branches_url":"https://api.github.com/repos/ros2/rcutils/branches{/branch}","tags_url":"https://api.github.com/repos/ros2/rcutils/tags","blobs_url":"https://api.github.com/repos/ros2/rcutils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros2/rcutils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros2/rcutils/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros2/rcutils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros2/rcutils/statuses/{sha}","languages_url":"https://api.github.com/repos/ros2/rcutils/languages","stargazers_url":"https://api.github.com/repos/ros2/rcutils/stargazers","contributors_url":"https://api.github.com/repos/ros2/rcutils/contributors","subscribers_url":"https://api.github.com/repos/ros2/rcutils/subscribers","subscription_url":"https://api.github.com/repos/ros2/rcutils/subscription","commits_url":"https://api.github.com/repos/ros2/rcutils/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros2/rcutils/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros2/rcutils/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros2/rcutils/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros2/rcutils/contents/{+path}","compare_url":"https://api.github.com/repos/ros2/rcutils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros2/rcutils/merges","archive_url":"https://api.github.com/repos/ros2/rcutils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros2/rcutils/downloads","issues_url":"https://api.github.com/repos/ros2/rcutils/issues{/number}","pulls_url":"https://api.github.com/repos/ros2/rcutils/pulls{/number}","milestones_url":"https://api.github.com/repos/ros2/rcutils/milestones{/number}","notifications_url":"https://api.github.com/repos/ros2/rcutils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros2/rcutils/labels{/name}","releases_url":"https://api.github.com/repos/ros2/rcutils/releases{/id}","deployments_url":"https://api.github.com/repos/ros2/rcutils/deployments","created_at":"2017-02-09T18:56:35Z","updated_at":"2018-06-08T00:12:34Z","pushed_at":"2018-06-11T23:07:35Z","git_url":"git://github.com/ros2/rcutils.git","ssh_url":"git@github.com:ros2/rcutils.git","clone_url":"https://github.com/ros2/rcutils.git","svn_url":"https://github.com/ros2/rcutils","homepage":"","size":308,"stargazers_count":8,"watchers_count":8,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":10,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":12,"open_issues":10,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ros2/rcutils/pulls/101"},"html":{"href":"https://github.com/ros2/rcutils/pull/101"},"issue":{"href":"https://api.github.com/repos/ros2/rcutils/issues/101"},"comments":{"href":"https://api.github.com/repos/ros2/rcutils/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/ros2/rcutils/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/ros2/rcutils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros2/rcutils/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/ros2/rcutils/statuses/1d10bec73846ff9bc8a39fbbaad4efe90f17d899"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"dhood"}}