Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXgSL-0006c7-BE for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Mar 2022 09:42:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nXgSK-00028v-7Q for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Mar 2022 09:42:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXgSJ-00028m-UV for pgsql-hackers@lists.postgresql.org; Fri, 25 Mar 2022 09:42:03 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXgSH-0007NL-P0 for pgsql-hackers@lists.postgresql.org; Fri, 25 Mar 2022 09:42:02 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id ABB265C00E7; Fri, 25 Mar 2022 05:42:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 25 Mar 2022 05:42:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=NXxnjIDNzk/PFbkz77/gRMX8TPugCrr9AHqU6EseA9M=; b=YgN1JxlM a7uuLbq7Z8JHuABMoi2wXIuEGTEwBGScpaMOoNfb78XtiyV4yB0GmdSrrouoCGrf JgVavac3tnGA22Ct7yoHH0PaKS5hocIZrSTRBhOIbFRoyq5l7YDDRbtdbyF6XV7z iFfVezoTygG+2QIesMz7ZiaO1e7V3Dq6b2G9aa7UFYDbss/AjCdIKw4YcjZf3Xeh 9pdyV2PxVtGxwpBM1yg7zq7yo3ZVhpduYHRXr4elHluxUqIFSg1f7qr2KXbujEm0 BXYUQpqBlNs8VZ0dYoXnINDU3+Y5XZi60L53dTic/jrHFOYywzo17HYQpJAoeLDD Ld+Uo8ymdyaA6Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudehuddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedujeevjeffjeevuddutedvkeeiueeitddvieelfeekveej udefgeeuvdejhfeuleenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 25 Mar 2022 05:42:00 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 41DE62A08E2; Fri, 25 Mar 2022 06:42:14 -0300 (-03) Date: Fri, 25 Mar 2022 10:42:14 +0100 From: Alvaro Herrera To: Japin Li Cc: Michael Paquier , pgsql-hackers@lists.postgresql.org Subject: Re: turn fastgetattr and heap_getattr to inline functions Message-ID: <202203250942.4vbvvbtkf6fq@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Mar-24, Japin Li wrote: > Thanks for your detail explaination. I find bottomup_sort_and_shrink_cmp() > has smilar code ... except that bottomup_sort_and_shrink_cmp never handles the case of the two structs being exactly identical, so I don't think this is a great counter-example. > IIUC, the last statement is used to keep the compiler quiet. However, > it doesn't exist in LWLockAttemptLock(). Why? What I do care about is the fact that LWLockAttemptLock does compile silently everywhere without a final "return dummy_value" statement. I don't have to build a theory for why the other function has a statement that may or may not be actually doing anything. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Los dioses no protegen a los insensatos. Éstos reciben protección de otros insensatos mejor dotados" (Luis Wu, Mundo Anillo)