{"action":"created","issue":{"url":"https://api.github.com/repos/iojs/io.js/issues/1144","labels_url":"https://api.github.com/repos/iojs/io.js/issues/1144/labels{/name}","comments_url":"https://api.github.com/repos/iojs/io.js/issues/1144/comments","events_url":"https://api.github.com/repos/iojs/io.js/issues/1144/events","html_url":"https://github.com/iojs/io.js/pull/1144","id":61197730,"number":1144,"title":"buffer: removing duplicate code","user":{"login":"thlorenz","id":192891,"avatar_url":"https://avatars.githubusercontent.com/u/192891?v=3","gravatar_id":"","url":"https://api.github.com/users/thlorenz","html_url":"https://github.com/thlorenz","followers_url":"https://api.github.com/users/thlorenz/followers","following_url":"https://api.github.com/users/thlorenz/following{/other_user}","gists_url":"https://api.github.com/users/thlorenz/gists{/gist_id}","starred_url":"https://api.github.com/users/thlorenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thlorenz/subscriptions","organizations_url":"https://api.github.com/users/thlorenz/orgs","repos_url":"https://api.github.com/users/thlorenz/repos","events_url":"https://api.github.com/users/thlorenz/events{/privacy}","received_events_url":"https://api.github.com/users/thlorenz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/iojs/io.js/labels/buffer","name":"buffer","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-13T19:28:28Z","updated_at":"2015-03-19T13:17:11Z","closed_at":"2015-03-19T13:17:11Z","pull_request":{"url":"https://api.github.com/repos/iojs/io.js/pulls/1144","html_url":"https://github.com/iojs/io.js/pull/1144","diff_url":"https://github.com/iojs/io.js/pull/1144.diff","patch_url":"https://github.com/iojs/io.js/pull/1144.patch"},"body":"- using an overload of Alloc that does the same that was being done\r\n  inside `Buffer::New`\r\n\r\nThe overload we now call inside `smalloc.cc` takes care of the same as\r\nthe code that was removed:\r\n\r\n```cc\r\nif (length == 0)\r\n  return Alloc(env, obj, nullptr, length, type);\r\n\r\nchar* data = static_cast<char*>(malloc(length));\r\nif (data == nullptr) {\r\n  FatalError(\"node::smalloc::Alloc(v8::Handle<v8::Object>, size_t,\"\r\n              \" v8::ExternalArrayType)\", \"Out Of Memory\");\r\n}\r\n\r\nAlloc(env, obj, data, length, type);\r\n```\r\n\r\n/cc @trevnorris "},"comment":{"url":"https://api.github.com/repos/iojs/io.js/issues/comments/83559364","html_url":"https://github.com/iojs/io.js/pull/1144#issuecomment-83559364","issue_url":"https://api.github.com/repos/iojs/io.js/issues/1144","id":83559364,"user":{"login":"bnoordhuis","id":275871,"avatar_url":"https://avatars.githubusercontent.com/u/275871?v=3","gravatar_id":"","url":"https://api.github.com/users/bnoordhuis","html_url":"https://github.com/bnoordhuis","followers_url":"https://api.github.com/users/bnoordhuis/followers","following_url":"https://api.github.com/users/bnoordhuis/following{/other_user}","gists_url":"https://api.github.com/users/bnoordhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/bnoordhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bnoordhuis/subscriptions","organizations_url":"https://api.github.com/users/bnoordhuis/orgs","repos_url":"https://api.github.com/users/bnoordhuis/repos","events_url":"https://api.github.com/users/bnoordhuis/events{/privacy}","received_events_url":"https://api.github.com/users/bnoordhuis/received_events","type":"User","site_admin":false},"created_at":"2015-03-19T13:17:11Z","updated_at":"2015-03-19T13:17:11Z","body":"Thanks Thorsten, landed in 813a536."}}