[RDY] add func_attr.h + add attributes to *alloc() family

This would finally enable us to use function attributes without making compilers that don't support them go crazy. Improves codegen for allocation functions. @jszakmeister ping.