{"action":"closed","number":2745,"pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/2745","id":85803585,"html_url":"https://github.com/ARMmbed/mbed-os/pull/2745","diff_url":"https://github.com/ARMmbed/mbed-os/pull/2745.diff","patch_url":"https://github.com/ARMmbed/mbed-os/pull/2745.patch","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2745","number":2745,"state":"closed","locked":false,"title":"Disable global objects destruction","user":{"login":"pan-","id":409941,"avatar_url":"https://avatars.githubusercontent.com/u/409941?v=3","gravatar_id":"","url":"https://api.github.com/users/pan-","html_url":"https://github.com/pan-","followers_url":"https://api.github.com/users/pan-/followers","following_url":"https://api.github.com/users/pan-/following{/other_user}","gists_url":"https://api.github.com/users/pan-/gists{/gist_id}","starred_url":"https://api.github.com/users/pan-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pan-/subscriptions","organizations_url":"https://api.github.com/users/pan-/orgs","repos_url":"https://api.github.com/users/pan-/repos","events_url":"https://api.github.com/users/pan-/events{/privacy}","received_events_url":"https://api.github.com/users/pan-/received_events","type":"User","site_admin":false},"body":"## Description\r\n\r\nThis pull request disable the destruction of global objects when exit is called. \r\nA different method is applied for each compiler: \r\n* IAR: use the compilation flag `--no_static_destruction`.\r\n* ARMCC: override `__aeabi_atexit`, `__cxa_atexit` and `__cxa_finalize`. The methodology is explained [here](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/6449.html).\r\n* GCC: For GCC it is a bit more complicated, depending on how it is compiled, it is possible or not to override the itanium abi calls. To ensure that the correct behavior is used, `exit` has been overridden to directly call `_exit` instead of calling in reverse order every function registered by `atexit`. In the meantime, `atexit` has been overridden to be a stub which does nothing. \r\n\r\n## Related PRs\r\nThis PR is a follow up of #2715 #2741 \r\n\r\n## Gain:\r\n\r\nThe test have been conducted upon [mbed-os-example-blinky](https://github.com/ARMmbed/mbed-os-example-blinky) compiled with NDEBUG enabled.\r\n\r\n* Without the patch: \r\n\r\n|     | GCC   | ARMCC | IAR   |\r\n|-----|-------|-------|-------|\r\n| RAM | 11832 | 10152 | 7970  |\r\n| ROM | 37008 | 26868 | 21266 |\r\n\r\n* With this patch #2715 and #2741 applied:\r\n\r\n|     | GCC         | ARMCC       | IAR         |\r\n|-----|-------------|-------------|-------------|\r\n| RAM | 9236 bytes | 8020 bytes  | 7350 bytes  |\r\n| ROM | 11480 bytes | 12686 bytes | 12398 bytes |\r\n\r\n* Difference: \r\n\r\n|     | GCC                 | ARMCC                 | IAR                  |\r\n|-----|---------------------|-----------------------|----------------------|\r\n| RAM | -2596 bytes (-21.94%)   | -2132 bytes (-21%)    | -620 bytes (7.8%)    |\r\n| ROM | -25528 bytes (-68.97%) | -14686 bytes (-52.8%) | -8868 bytes (-41.7%) |\r\n\r\n","created_at":"2016-09-19T14:27:13Z","updated_at":"2016-09-22T05:48:09Z","closed_at":"2016-09-22T05:48:08Z","merged_at":"2016-09-22T05:48:08Z","merge_commit_sha":"0c0455bf3feda95ab78cec76664df70b4e0c71b9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/2745/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/2745/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2745/comments","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/f4f8b491d1c6c28ddb148f2bcc65f7c550469d1d","head":{"label":"pan-:disable_global_objects_destruction","ref":"disable_global_objects_destruction","sha":"f4f8b491d1c6c28ddb148f2bcc65f7c550469d1d","user":{"login":"pan-","id":409941,"avatar_url":"https://avatars.githubusercontent.com/u/409941?v=3","gravatar_id":"","url":"https://api.github.com/users/pan-","html_url":"https://github.com/pan-","followers_url":"https://api.github.com/users/pan-/followers","following_url":"https://api.github.com/users/pan-/following{/other_user}","gists_url":"https://api.github.com/users/pan-/gists{/gist_id}","starred_url":"https://api.github.com/users/pan-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pan-/subscriptions","organizations_url":"https://api.github.com/users/pan-/orgs","repos_url":"https://api.github.com/users/pan-/repos","events_url":"https://api.github.com/users/pan-/events{/privacy}","received_events_url":"https://api.github.com/users/pan-/received_events","type":"User","site_admin":false},"repo":{"id":59667574,"name":"mbed","full_name":"pan-/mbed","owner":{"login":"pan-","id":409941,"avatar_url":"https://avatars.githubusercontent.com/u/409941?v=3","gravatar_id":"","url":"https://api.github.com/users/pan-","html_url":"https://github.com/pan-","followers_url":"https://api.github.com/users/pan-/followers","following_url":"https://api.github.com/users/pan-/following{/other_user}","gists_url":"https://api.github.com/users/pan-/gists{/gist_id}","starred_url":"https://api.github.com/users/pan-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pan-/subscriptions","organizations_url":"https://api.github.com/users/pan-/orgs","repos_url":"https://api.github.com/users/pan-/repos","events_url":"https://api.github.com/users/pan-/events{/privacy}","received_events_url":"https://api.github.com/users/pan-/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pan-/mbed","description":"mbed libraries and tools (Classic). For mbed OS, look here: https://www.mbed.com/en/development/software/mbed-os/","fork":true,"url":"https://api.github.com/repos/pan-/mbed","forks_url":"https://api.github.com/repos/pan-/mbed/forks","keys_url":"https://api.github.com/repos/pan-/mbed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pan-/mbed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pan-/mbed/teams","hooks_url":"https://api.github.com/repos/pan-/mbed/hooks","issue_events_url":"https://api.github.com/repos/pan-/mbed/issues/events{/number}","events_url":"https://api.github.com/repos/pan-/mbed/events","assignees_url":"https://api.github.com/repos/pan-/mbed/assignees{/user}","branches_url":"https://api.github.com/repos/pan-/mbed/branches{/branch}","tags_url":"https://api.github.com/repos/pan-/mbed/tags","blobs_url":"https://api.github.com/repos/pan-/mbed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pan-/mbed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pan-/mbed/git/refs{/sha}","trees_url":"https://api.github.com/repos/pan-/mbed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pan-/mbed/statuses/{sha}","languages_url":"https://api.github.com/repos/pan-/mbed/languages","stargazers_url":"https://api.github.com/repos/pan-/mbed/stargazers","contributors_url":"https://api.github.com/repos/pan-/mbed/contributors","subscribers_url":"https://api.github.com/repos/pan-/mbed/subscribers","subscription_url":"https://api.github.com/repos/pan-/mbed/subscription","commits_url":"https://api.github.com/repos/pan-/mbed/commits{/sha}","git_commits_url":"https://api.github.com/repos/pan-/mbed/git/commits{/sha}","comments_url":"https://api.github.com/repos/pan-/mbed/comments{/number}","issue_comment_url":"https://api.github.com/repos/pan-/mbed/issues/comments{/number}","contents_url":"https://api.github.com/repos/pan-/mbed/contents/{+path}","compare_url":"https://api.github.com/repos/pan-/mbed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pan-/mbed/merges","archive_url":"https://api.github.com/repos/pan-/mbed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pan-/mbed/downloads","issues_url":"https://api.github.com/repos/pan-/mbed/issues{/number}","pulls_url":"https://api.github.com/repos/pan-/mbed/pulls{/number}","milestones_url":"https://api.github.com/repos/pan-/mbed/milestones{/number}","notifications_url":"https://api.github.com/repos/pan-/mbed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pan-/mbed/labels{/name}","releases_url":"https://api.github.com/repos/pan-/mbed/releases{/id}","deployments_url":"https://api.github.com/repos/pan-/mbed/deployments","created_at":"2016-05-25T13:56:37Z","updated_at":"2016-05-25T13:57:34Z","pushed_at":"2016-09-19T14:19:24Z","git_url":"git://github.com/pan-/mbed.git","ssh_url":"git@github.com:pan-/mbed.git","clone_url":"https://github.com/pan-/mbed.git","svn_url":"https://github.com/pan-/mbed","homepage":"","size":64222,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ARMmbed:master","ref":"master","sha":"65ffa8cbb7f3cbedd052ffc4f4c90377d43fc2e3","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":8270972,"name":"mbed-os","full_name":"ARMmbed/mbed-os","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/mbed-os","description":"ARM mbed OS is a platform operating system designed for the internet of things","fork":false,"url":"https://api.github.com/repos/ARMmbed/mbed-os","forks_url":"https://api.github.com/repos/ARMmbed/mbed-os/forks","keys_url":"https://api.github.com/repos/ARMmbed/mbed-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/mbed-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/mbed-os/teams","hooks_url":"https://api.github.com/repos/ARMmbed/mbed-os/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/events","assignees_url":"https://api.github.com/repos/ARMmbed/mbed-os/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/mbed-os/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/tags","blobs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/mbed-os/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/mbed-os/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/mbed-os/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscription","commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/mbed-os/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/mbed-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/mbed-os/merges","archive_url":"https://api.github.com/repos/ARMmbed/mbed-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/mbed-os/downloads","issues_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/mbed-os/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/mbed-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/mbed-os/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/mbed-os/deployments","created_at":"2013-02-18T15:23:11Z","updated_at":"2016-09-21T22:27:05Z","pushed_at":"2016-09-22T05:48:08Z","git_url":"git://github.com/ARMmbed/mbed-os.git","ssh_url":"git@github.com:ARMmbed/mbed-os.git","clone_url":"https://github.com/ARMmbed/mbed-os.git","svn_url":"https://github.com/ARMmbed/mbed-os","homepage":"https://mbed.com","size":83049,"stargazers_count":752,"watchers_count":752,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":749,"mirror_url":null,"open_issues_count":375,"forks":749,"open_issues":375,"watchers":752,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/2745"},"html":{"href":"https://github.com/ARMmbed/mbed-os/pull/2745"},"issue":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2745"},"comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2745/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/2745/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/2745/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/f4f8b491d1c6c28ddb148f2bcc65f7c550469d1d"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"sg-","id":496002,"avatar_url":"https://avatars.githubusercontent.com/u/496002?v=3","gravatar_id":"","url":"https://api.github.com/users/sg-","html_url":"https://github.com/sg-","followers_url":"https://api.github.com/users/sg-/followers","following_url":"https://api.github.com/users/sg-/following{/other_user}","gists_url":"https://api.github.com/users/sg-/gists{/gist_id}","starred_url":"https://api.github.com/users/sg-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sg-/subscriptions","organizations_url":"https://api.github.com/users/sg-/orgs","repos_url":"https://api.github.com/users/sg-/repos","events_url":"https://api.github.com/users/sg-/events{/privacy}","received_events_url":"https://api.github.com/users/sg-/received_events","type":"User","site_admin":false},"comments":8,"review_comments":0,"commits":4,"additions":61,"deletions":3,"changed_files":4}}
{"actor":{"display_login":"sg-"}}