libstdc++: Add comment about memalign requirements

The memalign man page on Solaris and QNX lists an additional requirement
for the alignment value that is not present in all implementation of
that non-standard function. For both those targets we should actually be
using posix_memalign anyway, so it doesn't matter. This just adds a
comment making note of that fact.

libstdc++-v3/ChangeLog:

	* libsupc++/new_opa.cc (aligned_alloc): Add comment.
This commit is contained in:
Jonathan Wakely 2022-03-30 16:57:27 +01:00
parent cf68f5a6d2
commit 7f016919fc

View File

@ -87,6 +87,8 @@ aligned_alloc (std::size_t al, std::size_t sz)
static inline void*
aligned_alloc (std::size_t al, std::size_t sz)
{
// Solaris requires al >= sizeof a word and QNX requires >= sizeof(void*)
// but they both provide posix_memalign, so will use the definition above.
return memalign (al, sz);
}
#else // !HAVE__ALIGNED_MALLOC && !HAVE_POSIX_MEMALIGN && !HAVE_MEMALIGN