[PATCH 2/2] manual/memory.texi: Document aligned_alloc.
Rich Felker
dalias@aerifal.cx
Thu Nov 7 03:44:00 GMT 2013
On Wed, Nov 06, 2013 at 11:17:41AM -0800, Paul Eggert wrote:
> Looks pretty good. Some suggestions:
>
> > +This function was introduced in @w{ISO C11} and hence may have better
> > +portability to modern non-POSIX systems than @code{posix_memalign}.
>
> A similar note should be put in posix_memalign's documentation.
> Something like this, perhaps?
It would also be nice to mention the danger of posix_memalign's
interface -- the void **-based interface encourages aliasing
violations of the form:
char *p;
int err = posix_memalign((void **)&p, 16, n);
As such, it should be deprecated.
Rich
More information about the Libc-alpha
mailing list