This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] manual/memory.texi: Document aligned_alloc.


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'.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]