{"action":"closed","number":3342,"pull_request":{"url":"https://api.github.com/repos/mruby/mruby/pulls/3342","id":97603912,"html_url":"https://github.com/mruby/mruby/pull/3342","diff_url":"https://github.com/mruby/mruby/pull/3342.diff","patch_url":"https://github.com/mruby/mruby/pull/3342.patch","issue_url":"https://api.github.com/repos/mruby/mruby/issues/3342","number":3342,"state":"closed","locked":false,"title":"Fix calculation of new string capacity.","user":{"login":"clayton-shopify","id":11052374,"avatar_url":"https://avatars.githubusercontent.com/u/11052374?v=3","gravatar_id":"","url":"https://api.github.com/users/clayton-shopify","html_url":"https://github.com/clayton-shopify","followers_url":"https://api.github.com/users/clayton-shopify/followers","following_url":"https://api.github.com/users/clayton-shopify/following{/other_user}","gists_url":"https://api.github.com/users/clayton-shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/clayton-shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clayton-shopify/subscriptions","organizations_url":"https://api.github.com/users/clayton-shopify/orgs","repos_url":"https://api.github.com/users/clayton-shopify/repos","events_url":"https://api.github.com/users/clayton-shopify/events{/privacy}","received_events_url":"https://api.github.com/users/clayton-shopify/received_events","type":"User","site_admin":false},"body":"@matz \r\n\r\nIf MRuby is compiled with `MRB_INT16`, then the following code causes a crash:\r\n```ruby\r\nloop { ([0]*10000).to_s }\r\n```\r\nThis happens because `str_buf_cat` incorrectly computes the new string capacity, choosing a capacity which is 1/4096 of the needed value: https://github.com/mruby/mruby/blob/9cef2654025e6646b1d0ff259086fc9eb02fff84/src/string.c#L166\r\n\r\nTo fix this I'm proposing to change the capacity calculation to match what's done for arrays: https://github.com/mruby/mruby/blob/647ad29a7a1147e2c3ed93329cabbb974482697f/src/array.c#L180-L184","created_at":"2016-12-12T18:09:23Z","updated_at":"2016-12-13T01:55:14Z","closed_at":"2016-12-13T01:55:14Z","merged_at":null,"merge_commit_sha":"0cc241dd5d52581a2e09734ae73d7f2c7cb964cb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mruby/mruby/pulls/3342/commits","review_comments_url":"https://api.github.com/repos/mruby/mruby/pulls/3342/comments","review_comment_url":"https://api.github.com/repos/mruby/mruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mruby/mruby/issues/3342/comments","statuses_url":"https://api.github.com/repos/mruby/mruby/statuses/0c82816e6a498e5437f6b873f5d4afc5f9e7627d","head":{"label":"clayton-shopify:fix-str-buf-cat","ref":"fix-str-buf-cat","sha":"0c82816e6a498e5437f6b873f5d4afc5f9e7627d","user":{"login":"clayton-shopify","id":11052374,"avatar_url":"https://avatars.githubusercontent.com/u/11052374?v=3","gravatar_id":"","url":"https://api.github.com/users/clayton-shopify","html_url":"https://github.com/clayton-shopify","followers_url":"https://api.github.com/users/clayton-shopify/followers","following_url":"https://api.github.com/users/clayton-shopify/following{/other_user}","gists_url":"https://api.github.com/users/clayton-shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/clayton-shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clayton-shopify/subscriptions","organizations_url":"https://api.github.com/users/clayton-shopify/orgs","repos_url":"https://api.github.com/users/clayton-shopify/repos","events_url":"https://api.github.com/users/clayton-shopify/events{/privacy}","received_events_url":"https://api.github.com/users/clayton-shopify/received_events","type":"User","site_admin":false},"repo":{"id":46997118,"name":"mruby","full_name":"clayton-shopify/mruby","owner":{"login":"clayton-shopify","id":11052374,"avatar_url":"https://avatars.githubusercontent.com/u/11052374?v=3","gravatar_id":"","url":"https://api.github.com/users/clayton-shopify","html_url":"https://github.com/clayton-shopify","followers_url":"https://api.github.com/users/clayton-shopify/followers","following_url":"https://api.github.com/users/clayton-shopify/following{/other_user}","gists_url":"https://api.github.com/users/clayton-shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/clayton-shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clayton-shopify/subscriptions","organizations_url":"https://api.github.com/users/clayton-shopify/orgs","repos_url":"https://api.github.com/users/clayton-shopify/repos","events_url":"https://api.github.com/users/clayton-shopify/events{/privacy}","received_events_url":"https://api.github.com/users/clayton-shopify/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/clayton-shopify/mruby","description":"Lightweight Ruby","fork":true,"url":"https://api.github.com/repos/clayton-shopify/mruby","forks_url":"https://api.github.com/repos/clayton-shopify/mruby/forks","keys_url":"https://api.github.com/repos/clayton-shopify/mruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clayton-shopify/mruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clayton-shopify/mruby/teams","hooks_url":"https://api.github.com/repos/clayton-shopify/mruby/hooks","issue_events_url":"https://api.github.com/repos/clayton-shopify/mruby/issues/events{/number}","events_url":"https://api.github.com/repos/clayton-shopify/mruby/events","assignees_url":"https://api.github.com/repos/clayton-shopify/mruby/assignees{/user}","branches_url":"https://api.github.com/repos/clayton-shopify/mruby/branches{/branch}","tags_url":"https://api.github.com/repos/clayton-shopify/mruby/tags","blobs_url":"https://api.github.com/repos/clayton-shopify/mruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clayton-shopify/mruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clayton-shopify/mruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/clayton-shopify/mruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clayton-shopify/mruby/statuses/{sha}","languages_url":"https://api.github.com/repos/clayton-shopify/mruby/languages","stargazers_url":"https://api.github.com/repos/clayton-shopify/mruby/stargazers","contributors_url":"https://api.github.com/repos/clayton-shopify/mruby/contributors","subscribers_url":"https://api.github.com/repos/clayton-shopify/mruby/subscribers","subscription_url":"https://api.github.com/repos/clayton-shopify/mruby/subscription","commits_url":"https://api.github.com/repos/clayton-shopify/mruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/clayton-shopify/mruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/clayton-shopify/mruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/clayton-shopify/mruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/clayton-shopify/mruby/contents/{+path}","compare_url":"https://api.github.com/repos/clayton-shopify/mruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clayton-shopify/mruby/merges","archive_url":"https://api.github.com/repos/clayton-shopify/mruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clayton-shopify/mruby/downloads","issues_url":"https://api.github.com/repos/clayton-shopify/mruby/issues{/number}","pulls_url":"https://api.github.com/repos/clayton-shopify/mruby/pulls{/number}","milestones_url":"https://api.github.com/repos/clayton-shopify/mruby/milestones{/number}","notifications_url":"https://api.github.com/repos/clayton-shopify/mruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clayton-shopify/mruby/labels{/name}","releases_url":"https://api.github.com/repos/clayton-shopify/mruby/releases{/id}","deployments_url":"https://api.github.com/repos/clayton-shopify/mruby/deployments","created_at":"2015-11-27T19:54:40Z","updated_at":"2016-11-23T14:13:30Z","pushed_at":"2016-12-12T18:05:15Z","git_url":"git://github.com/clayton-shopify/mruby.git","ssh_url":"git@github.com:clayton-shopify/mruby.git","clone_url":"https://github.com/clayton-shopify/mruby.git","svn_url":"https://github.com/clayton-shopify/mruby","homepage":null,"size":9054,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mruby:master","ref":"master","sha":"647ad29a7a1147e2c3ed93329cabbb974482697f","user":{"login":"mruby","id":1796512,"avatar_url":"https://avatars.githubusercontent.com/u/1796512?v=3","gravatar_id":"","url":"https://api.github.com/users/mruby","html_url":"https://github.com/mruby","followers_url":"https://api.github.com/users/mruby/followers","following_url":"https://api.github.com/users/mruby/following{/other_user}","gists_url":"https://api.github.com/users/mruby/gists{/gist_id}","starred_url":"https://api.github.com/users/mruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruby/subscriptions","organizations_url":"https://api.github.com/users/mruby/orgs","repos_url":"https://api.github.com/users/mruby/repos","events_url":"https://api.github.com/users/mruby/events{/privacy}","received_events_url":"https://api.github.com/users/mruby/received_events","type":"Organization","site_admin":false},"repo":{"id":4073516,"name":"mruby","full_name":"mruby/mruby","owner":{"login":"mruby","id":1796512,"avatar_url":"https://avatars.githubusercontent.com/u/1796512?v=3","gravatar_id":"","url":"https://api.github.com/users/mruby","html_url":"https://github.com/mruby","followers_url":"https://api.github.com/users/mruby/followers","following_url":"https://api.github.com/users/mruby/following{/other_user}","gists_url":"https://api.github.com/users/mruby/gists{/gist_id}","starred_url":"https://api.github.com/users/mruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruby/subscriptions","organizations_url":"https://api.github.com/users/mruby/orgs","repos_url":"https://api.github.com/users/mruby/repos","events_url":"https://api.github.com/users/mruby/events{/privacy}","received_events_url":"https://api.github.com/users/mruby/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mruby/mruby","description":"Lightweight Ruby","fork":false,"url":"https://api.github.com/repos/mruby/mruby","forks_url":"https://api.github.com/repos/mruby/mruby/forks","keys_url":"https://api.github.com/repos/mruby/mruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mruby/mruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mruby/mruby/teams","hooks_url":"https://api.github.com/repos/mruby/mruby/hooks","issue_events_url":"https://api.github.com/repos/mruby/mruby/issues/events{/number}","events_url":"https://api.github.com/repos/mruby/mruby/events","assignees_url":"https://api.github.com/repos/mruby/mruby/assignees{/user}","branches_url":"https://api.github.com/repos/mruby/mruby/branches{/branch}","tags_url":"https://api.github.com/repos/mruby/mruby/tags","blobs_url":"https://api.github.com/repos/mruby/mruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mruby/mruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mruby/mruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/mruby/mruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mruby/mruby/statuses/{sha}","languages_url":"https://api.github.com/repos/mruby/mruby/languages","stargazers_url":"https://api.github.com/repos/mruby/mruby/stargazers","contributors_url":"https://api.github.com/repos/mruby/mruby/contributors","subscribers_url":"https://api.github.com/repos/mruby/mruby/subscribers","subscription_url":"https://api.github.com/repos/mruby/mruby/subscription","commits_url":"https://api.github.com/repos/mruby/mruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/mruby/mruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/mruby/mruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/mruby/mruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/mruby/mruby/contents/{+path}","compare_url":"https://api.github.com/repos/mruby/mruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mruby/mruby/merges","archive_url":"https://api.github.com/repos/mruby/mruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mruby/mruby/downloads","issues_url":"https://api.github.com/repos/mruby/mruby/issues{/number}","pulls_url":"https://api.github.com/repos/mruby/mruby/pulls{/number}","milestones_url":"https://api.github.com/repos/mruby/mruby/milestones{/number}","notifications_url":"https://api.github.com/repos/mruby/mruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mruby/mruby/labels{/name}","releases_url":"https://api.github.com/repos/mruby/mruby/releases{/id}","deployments_url":"https://api.github.com/repos/mruby/mruby/deployments","created_at":"2012-04-19T09:11:15Z","updated_at":"2016-12-12T05:21:11Z","pushed_at":"2016-12-13T01:55:06Z","git_url":"git://github.com/mruby/mruby.git","ssh_url":"git@github.com:mruby/mruby.git","clone_url":"https://github.com/mruby/mruby.git","svn_url":"https://github.com/mruby/mruby","homepage":null,"size":17818,"stargazers_count":3679,"watchers_count":3679,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":566,"mirror_url":null,"open_issues_count":140,"forks":566,"open_issues":140,"watchers":3679,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mruby/mruby/pulls/3342"},"html":{"href":"https://github.com/mruby/mruby/pull/3342"},"issue":{"href":"https://api.github.com/repos/mruby/mruby/issues/3342"},"comments":{"href":"https://api.github.com/repos/mruby/mruby/issues/3342/comments"},"review_comments":{"href":"https://api.github.com/repos/mruby/mruby/pulls/3342/comments"},"review_comment":{"href":"https://api.github.com/repos/mruby/mruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mruby/mruby/pulls/3342/commits"},"statuses":{"href":"https://api.github.com/repos/mruby/mruby/statuses/0c82816e6a498e5437f6b873f5d4afc5f9e7627d"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":4,"deletions":4,"changed_files":1}}
{"actor":{"display_login":"matz"}}