提交 4c346919 编写于 作者: R Rich Felker

trivial optimization to printf: avoid wasted call frame

amusingly, this cuts more than 10% off the run time of printf("a"); on
the machine i tested it on.

sadly the same optimization is not possible for snprintf without
duplicating all the pseudo-FILE setup code, which is not worth it.
上级 e3ebe7db
......@@ -6,7 +6,7 @@ int printf(const char *fmt, ...)
int ret;
va_list ap;
va_start(ap, fmt);
ret = vprintf(fmt, ap);
ret = vfprintf(stdout, fmt, ap);
va_end(ap);
return ret;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册