Use __attribute__((malloc)) for gcc 3.2
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Christoph Hellwig
Review
Quoted 2 lines · Andi Kleen
(quoted diff) +1
-1-extern pgd_t *pgd_alloc(struct mm_struct *); +extern pgd_t *pgd_alloc(struct mm_struct *) malloc_function;Anz chance you could make that
__malloc? That how the other atrributes in the kernel (e.g. __init/__exit) work.
No.
Quoted 11 lines
Review
Quoted 9 lines
(quoted diff) +8
-0+/* Function allocates new memory and return cannot alias with anything */ +#define malloc_function __attribute__((malloc)) +/* Never inline */ +#define noinline __attribute__((noinline)) +#else +#define malloc_function +#define noinline +#endifDito for
__noinline? And IMHOcompiler.his the better place for this.
Because I dislike all the __. It's just useless visual clutter and doesn't follow the usual convention of prefixing only low level functions with this. Also now that the kernel has given up on ANSI/POSIX name space cleanliness it is double plus useless.
Same thing for __get_cpu_var for example. The __ is completely useless.
I will move it into linux/compiler.h to add some more clutter to include hell, because it requires even more #include <linux/compiler.h>
Quoted 1 line
BTW, do you have any stats on the better optimization?
With this it sings twice as loud and dances twice and a half times as fast.
No, with gcc 3.2 it doesn't seem to make much difference.
More important is that will allow better optimization by gcc in the future. In kernel land the gcc optimizer is already a bit crippled because of the -fno-strict-aliasing use. This will hopefully help a bit.
-Andi
Quoted 4 lines · Andi Kleen
...
I will move it intolinux/compiler.hto add some more clutter to include hell, because it requires even more #include <linux/compiler.h>
...
kernel.h includes compiler.h so it shouldn't make a difference.
Quoted 1 line
-Andi
cu
Adrian
Signature · 3 lines
You only think this is a free country. Like the US the UK spends a lot of time explaining its a free country because its a police state. Alan Cox
From: Andi Kleen <[email protected]>
Date: 29 Sep 2002 21:09:26 +0200
No, with gcc 3.2 it doesn't seem to make much difference.
Because -fno-strict-aliasing is still in CFLAGS. Your change is pointless until that situation changes.