aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-03-30 16:57:27 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-03-31 16:18:00 +0100
commit7f016919fc8a042b83812ae5f34946ef23b7adb3 (patch)
treef13b88c0859b1d4299d3ad0c9f0af367e1ea316f
parentcf68f5a6d20db2aee2f3e674ad3f10e1c458edf9 (diff)
downloadgcc-7f016919fc8a042b83812ae5f34946ef23b7adb3.zip
gcc-7f016919fc8a042b83812ae5f34946ef23b7adb3.tar.gz
gcc-7f016919fc8a042b83812ae5f34946ef23b7adb3.tar.bz2
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.
-rw-r--r--libstdc++-v3/libsupc++/new_opa.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/libstdc++-v3/libsupc++/new_opa.cc b/libstdc++-v3/libsupc++/new_opa.cc
index 5f24737..411cd8d 100644
--- a/libstdc++-v3/libsupc++/new_opa.cc
+++ b/libstdc++-v3/libsupc++/new_opa.cc
@@ -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