Explorar o código

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.
Rich Felker %!s(int64=12) %!d(string=hai) anos
pai
achega
4c346919a9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/stdio/printf.c

+ 1 - 1
src/stdio/printf.c

@@ -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;
 }