The malloc attribute allows compiler to do some optmizations on functions that behave like malloc/calloc, like assuming that the returned pointer do not alias other pointers.
The malloc attribute allows compiler to do some optmizations on functions that behave like malloc/calloc, like assuming that the returned pointer do not alias other pointers.