diff options
author | das <das@FreeBSD.org> | 2009-01-31 18:27:02 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2009-01-31 18:27:02 +0000 |
commit | 61dc3e056cc2ad51f33f296f1cfda0ece440b85e (patch) | |
tree | 86563ca98ba62d850839a916a23d185416bda1b7 /tools/regression/lib/libc/stdio/test-printfloat.c | |
parent | fb1404080f89a63cdf36da668e5ff4fc65cfa4d9 (diff) | |
download | FreeBSD-src-61dc3e056cc2ad51f33f296f1cfda0ece440b85e.zip FreeBSD-src-61dc3e056cc2ad51f33f296f1cfda0ece440b85e.tar.gz |
Add a function attribute called `__malloc_like', which informs gcc
that the annotated function returns a pointer that doesn't alias any
extant pointer. This results in a 50%+ speedup in microbenchmarks such
as the following:
char *cp = malloc(1), *buf = malloc(BUF);
for (i = 0; i < BUF; i++) buf[i] = *cp;
In real programs, your mileage will vary. Note that gcc already
performs this optimization automatically for any function called
`malloc', `calloc', `strdup', or `strndup' unless -fno-builtins is
used.
Diffstat (limited to 'tools/regression/lib/libc/stdio/test-printfloat.c')
0 files changed, 0 insertions, 0 deletions