PATCH: add malloc function attribute to rts malloc functions

Simon Marlow simonmar at microsoft.com
Tue Mar 23 05:04:43 EST 2004


 
> http://gcc.gnu.org/onlinedocs/gcc-3.3.3/gcc/Function-Attributes.html
> The gcc manual says:  
> 
> malloc
>         The malloc attribute is used to tell the compiler that a
>         function may be treated as if it were the malloc function. The
>         compiler assumes that calls to malloc result in pointers that
>         cannot alias anything. This will often improve optimization.
> 
> Note the malloc attribute has only been around since gcc 
> 3.xx, hence the
> extra GNUC3_ATTRIBUTE that tests for gcc version >= 3.
> 
> So I guess it can't hurt and might even help. It even compiles! (as is
> running make in the rts directory does not fail - I've not done a full
> build.)

Committed; thanks!

Simon


More information about the Glasgow-haskell-bugs mailing list