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 ESMTP id 981133857829 for ; Tue, 23 Mar 2021 20:44:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 981133857829 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-118-SBfBQNmvMPKaTYst-bMONg-1; Tue, 23 Mar 2021 16:44:13 -0400 X-MC-Unique: SBfBQNmvMPKaTYst-bMONg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D36C11B2C983; Tue, 23 Mar 2021 20:44:12 +0000 (UTC) Received: from rhel8.vm.delorie.com (ovpn-112-40.rdu2.redhat.com [10.10.112.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E9841007606; Tue, 23 Mar 2021 20:44:12 +0000 (UTC) Received: from rhel8.vm.redhat.com (localhost [127.0.0.1]) by rhel8.vm.delorie.com (8.15.2/8.15.2) with ESMTP id 12NKiBDi047901; Tue, 23 Mar 2021 16:44:11 -0400 From: DJ Delorie To: Szabolcs Nagy Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 5/6] malloc: Remove unnecessary tagging around _mid_memalign In-Reply-To: <7203bf2d0d1405daa5d1c62744abf8ceee85b5bb.1616155129.git.szabolcs.nagy@arm.com> (message from Szabolcs Nagy on Fri, 19 Mar 2021 13:27:27 +0000) Date: Tue, 23 Mar 2021 16:44:11 -0400 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2021 20:44:16 -0000 Szabolcs Nagy writes: > The internal _mid_memalign already returns newly tagged memory. > (__libc_memalign and posix_memalign already relied on this, this > patch fixes the other call sites.) LGTM. Reviewed-by: DJ Delorie > void * > __libc_valloc (size_t bytes) > { > - void *p; > - > if (__malloc_initialized < 0) > ptmalloc_init (); > > void *address = RETURN_ADDRESS (0); > size_t pagesize = GLRO (dl_pagesize); > - p = _mid_memalign (pagesize, bytes, address); > - return tag_new_usable (p); > + return _mid_memalign (pagesize, bytes, address); > } > > void * > __libc_pvalloc (size_t bytes) > { > - void *p; > - > if (__malloc_initialized < 0) > ptmalloc_init (); > > @@ -3585,8 +3580,7 @@ __libc_pvalloc (size_t bytes) > } > rounded_bytes = rounded_bytes & -(pagesize - 1); > > - p = _mid_memalign (pagesize, rounded_bytes, address); > - return tag_new_usable (p); > + return _mid_memalign (pagesize, rounded_bytes, address); > }