Interface __MALLOC_ATTR__

Preprocessor macro expanding to a type attribute

#include <SYS/TYPES.H>

void * __MALLOC_ATTR__ function(args...);

Description

This macro expands to a compiler-specific attribute telling that the function allocates memory — i.e. it advises the compiler that the returned pointer doesn't alias any other memory object.

It enables the compiler to do better optimizations.

Implementation note

When using the gcc compiler, this macro expands to __attribute__((__malloc__)).