{"action":"created","issue":{"url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/2926","labels_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/2926/labels{/name}","comments_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/2926/comments","events_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/2926/events","html_url":"https://github.com/D-Programming-Language/phobos/pull/2926","id":55722610,"number":2926,"title":"Copy variadic arguments to buffer to avoid horrific varargs hacks","user":{"login":"yebblies","id":580100,"avatar_url":"https://avatars.githubusercontent.com/u/580100?v=3","gravatar_id":"","url":"https://api.github.com/users/yebblies","html_url":"https://github.com/yebblies","followers_url":"https://api.github.com/users/yebblies/followers","following_url":"https://api.github.com/users/yebblies/following{/other_user}","gists_url":"https://api.github.com/users/yebblies/gists{/gist_id}","starred_url":"https://api.github.com/users/yebblies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yebblies/subscriptions","organizations_url":"https://api.github.com/users/yebblies/orgs","repos_url":"https://api.github.com/users/yebblies/repos","events_url":"https://api.github.com/users/yebblies/events{/privacy}","received_events_url":"https://api.github.com/users/yebblies/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-28T07:17:59Z","updated_at":"2015-01-28T08:38:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/phobos/pulls/2926","html_url":"https://github.com/D-Programming-Language/phobos/pull/2926","diff_url":"https://github.com/D-Programming-Language/phobos/pull/2926.diff","patch_url":"https://github.com/D-Programming-Language/phobos/pull/2926.patch"},"body":"The current implementation of `doFormat` forges a `va_list` so it can recurse to print out array and AA members.  This was straightforward on X86, but the complexity of X86_64 varargs abis means that it has to jump through some rather horrific and non-portable hoops to get this to work.\r\n\r\nThis replacement implementation instead copies all variadic arguments to a buffer, being careful to preserve required alignment.  This allows the arguments to be iterated through with a simple pointer on all platforms.\r\n\r\nThe copy to the buffer naturally comes with a slight performance penalty, but given the simplification of the code, the improved portability, and the fact that `doFormat`'s only remaining caller is `std.stream`, I think it's worth that cost.\r\n\r\n@andralex @ibuclaw "},"comment":{"url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/comments/71798500","html_url":"https://github.com/D-Programming-Language/phobos/pull/2926#issuecomment-71798500","issue_url":"https://api.github.com/repos/D-Programming-Language/phobos/issues/2926","id":71798500,"user":{"login":"andralex","id":566679,"avatar_url":"https://avatars.githubusercontent.com/u/566679?v=3","gravatar_id":"","url":"https://api.github.com/users/andralex","html_url":"https://github.com/andralex","followers_url":"https://api.github.com/users/andralex/followers","following_url":"https://api.github.com/users/andralex/following{/other_user}","gists_url":"https://api.github.com/users/andralex/gists{/gist_id}","starred_url":"https://api.github.com/users/andralex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andralex/subscriptions","organizations_url":"https://api.github.com/users/andralex/orgs","repos_url":"https://api.github.com/users/andralex/repos","events_url":"https://api.github.com/users/andralex/events{/privacy}","received_events_url":"https://api.github.com/users/andralex/received_events","type":"User","site_admin":false},"created_at":"2015-01-28T08:38:02Z","updated_at":"2015-01-28T08:38:02Z","body":"Auto-merge toggled on"}}