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.129.124]) by sourceware.org (Postfix) with ESMTPS id 46C463856DCA for ; Tue, 19 Jul 2022 17:32:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 46C463856DCA Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-4T4_sydxOwKpGlhWcG8Wcg-1; Tue, 19 Jul 2022 13:32:22 -0400 X-MC-Unique: 4T4_sydxOwKpGlhWcG8Wcg-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 121593C1022E for ; Tue, 19 Jul 2022 17:32:22 +0000 (UTC) Received: from greed.delorie.com (unknown [10.22.8.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F12D02026987; Tue, 19 Jul 2022 17:32:21 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.15.2/8.15.2) with ESMTP id 26JHWLKF467582; Tue, 19 Jul 2022 13:32:21 -0400 From: DJ Delorie To: Florian Weimer Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v2 1/1] memalign: Support scanning for aligned chunks. In-Reply-To: <878ropa29e.fsf@oldenburg.str.redhat.com> Date: Tue, 19 Jul 2022 13:32:21 -0400 Message-ID: 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-Type: text/plain X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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, 19 Jul 2022 17:32:25 -0000 Florian Weimer writes: > MAYBE_INIT_TCACHE does not seem necessary. If the tcache is empty, > there's no need to initialize it and scane it. > The tcache null check should be written as tcache != NULL. Literal cut-n-paste from elsewhere in the code ;-) > And why not scan the entire chain here? Speed. The tcache list is not designed to be easy to access in the middle. I know that's a weak excuse, but keeping everything going through tcache_get() and tcache_put() both simplifies and robustifies the code.