From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id DC08C3858C54 for ; Thu, 31 Mar 2022 15:22:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DC08C3858C54 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-f2gX1JjcOhSuUXQI-CwY3Q-1; Thu, 31 Mar 2022 11:22:17 -0400 X-MC-Unique: f2gX1JjcOhSuUXQI-CwY3Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 55C5A9360F3; Thu, 31 Mar 2022 15:22:17 +0000 (UTC) Received: from localhost (unknown [10.33.36.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 579CC2026D64; Thu, 31 Mar 2022 15:22:13 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Add comment about memalign requirements Date: Thu, 31 Mar 2022 16:22:11 +0100 Message-Id: <20220331152211.1895051-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2022 15:22:21 -0000 Pushed to trunk. -- >8 -- 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. --- 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 -- 2.34.1