This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] manual/memory.texi: Document aligned_alloc.
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Will Newton <will dot newton at linaro dot org>, libc-alpha at sourceware dot org
- Cc: Patch Tracking <patches at linaro dot org>
- Date: Wed, 06 Nov 2013 11:17:41 -0800
- Subject: Re: [PATCH 2/2] manual/memory.texi: Document aligned_alloc.
- Authentication-results: sourceware.org; auth=none
- References: <527A6F4E dot 4020006 at linaro dot org>
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?
Although this function is superseded by @code{aligned_alloc}, it was
standardized in POSIX.1-2004 and is more portable to older POSIX
systems that do not support @w{ISO C11}.
> -power of two than that, use @code{posix_memalign}. @code{posix_memalign}
> -is declared in @file{stdlib.h}.
> +power of two than that, use @code{posix_memalign} or
> +@code{aligned_alloc}. @code{posix_memalign} and @code{aligned_alloc}
> +are declared in @file{stdlib.h}.
I would mention only aligned_alloc here; now that we have it, there's
no reason to recommend posix_memalign.
> -The @code{memalign} function is obsolete and @code{posix_memalign} should
> -be used instead.
> +The @code{memalign} function is obsolete and @code{posix_memalign} or
> +@code{aligned_alloc} should be used instead.
Likewise here.
> -The @code{valloc} function is obsolete and @code{posix_memalign} should
> -be used instead.
> +The @code{valloc} function is obsolete and @code{posix_memalign} or
> +@code{aligned_alloc} should be used instead.
And here.
> +The value of this variable is a pointer to function that @code{aligned_alloc},
> +@code{memalign}, @code{posix_memalign} and @code{valloc} use whenever they
> +are called. You should define this function to look like @code{memalign};
Change the last 'memalign' to 'aligned_alloc'.