From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 156761F5AE for ; Fri, 11 Jun 2021 06:28:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbhFKGaF (ORCPT ); Fri, 11 Jun 2021 02:30:05 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:54532 "EHLO pb-smtp21.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbhFKGaF (ORCPT ); Fri, 11 Jun 2021 02:30:05 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id C4DCE149912; Fri, 11 Jun 2021 02:28:07 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=yWdL3iAM8qf15njzI72DZLSj74PLPX1ApIgh/9 xOqug=; b=K+vzCVb9rsl6AAFPl6ER/1fADP5V73vsd9ojXY8FkNMzBQCXUXsUE0 TEdoDDMizRgerHgQ1q6XUMgaKVtQGnP+y3J+HMulnafhw6T4y7l2wsq+WKMtugQR 2qoGYHm/XeNDE2kccyeZVczpM/mcswF/v1Iw15JjVDwgzKm+6vrtQ= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id BD151149911; Fri, 11 Jun 2021 02:28:07 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [104.196.172.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 0C735149910; Fri, 11 Jun 2021 02:28:04 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Chris Torek Cc: Andrzej Hunt via GitGitGadget , Git List , Andrzej Hunt , Andrzej Hunt Subject: Re: [PATCH 3/3] builtin/checkout--worker: memset struct to avoid MSAN complaints References: Date: Fri, 11 Jun 2021 15:28:03 +0900 In-Reply-To: (Chris Torek's message of "Thu, 10 Jun 2021 21:43:27 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 2DF5862A-CA7E-11EB-B933-FA9E2DDBB1FC-77302942!pb-smtp21.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Chris Torek writes: > On Thu, Jun 10, 2021 at 9:49 AM Andrzej Hunt via GitGitGadget > wrote: >> [snip] Therefore we add a >> memset to convince MSAN that this memory is safe to read - but only >> when building with MSAN to avoid this cost in normal usage. > > It does not seem likely to be that expensive, and would definitely > be shorter without all the `#if` testing: > >> diff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c >> index 289a9b8f89d0..02fa5285988f 100644 >> --- a/builtin/checkout--worker.c >> +++ b/builtin/checkout--worker.c >> @@ -56,6 +56,17 @@ static void report_result(struct parallel_checkout_item *pc_item) >> struct pc_item_result res; > > This could just have `= { 0 }` added. I'd prefer that very much more than the #if testing, within which // comments that we do not want in our codebase are enclosed. Thanks.