From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 616413858C54; Thu, 31 Mar 2022 15:21:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 616413858C54 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-7938] libstdc++: Add comment about memalign requirements X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: cf68f5a6d20db2aee2f3e674ad3f10e1c458edf9 X-Git-Newrev: 7f016919fc8a042b83812ae5f34946ef23b7adb3 Message-Id: <20220331152123.616413858C54@sourceware.org> Date: Thu, 31 Mar 2022 15:21:23 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2022 15:21:23 -0000 https://gcc.gnu.org/g:7f016919fc8a042b83812ae5f34946ef23b7adb3 commit r12-7938-g7f016919fc8a042b83812ae5f34946ef23b7adb3 Author: Jonathan Wakely Date: Wed Mar 30 16:57:27 2022 +0100 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. Diff: --- libstdc++-v3/libsupc++/new_opa.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/libsupc++/new_opa.cc b/libstdc++-v3/libsupc++/new_opa.cc index 5f24737de1c..411cd8d98b2 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