Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6JXb-00C6UX-UM for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Oct 2024 01:00:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t6JXa-00E5XA-0s for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Oct 2024 00:59:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6JXY-00E5Wz-Gg for pgsql-hackers@lists.postgresql.org; Thu, 31 Oct 2024 00:59:58 +0000 Received: from fhigh-a4-smtp.messagingengine.com ([103.168.172.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t6JXV-003hy2-VA for pgsql-hackers@lists.postgresql.org; Thu, 31 Oct 2024 00:59:55 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id A56611140172; Wed, 30 Oct 2024 20:59:52 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Wed, 30 Oct 2024 20:59:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1730336392; x=1730422792; bh=yA3hYcLMpo 7PVYQOnHOPfmnXU3c2xRezzDJYDtweEEQ=; b=Mh5HwOUW+k/p3bGahs+GPJdpRl 8/YD5a/KUe80WRohxhAwimJ2fK52cwNIuMAICZgy1DclBBSlq9GjdxCUua+TM+ta PBT7B9ON95LbQKm6j27iOZzQNYM7/TuY8hyG9OBEZ/9Q08Z/47Ap6Ol6AYIUH8nJ MRB3nDU33IQrws4Z6G2m+Q3KelnV6uIo6cjCAIjlMSgpqDo+bh9OEEAbvCSWY6v0 YkgmRt2RIhDKz+AEiourelXJbDI7sND5cLep3ajRhzHW39Qzllh9dXAMFijV+EOQ Hqka5F+zNaV34DAUDQ2R+9YDWq3E3L1XjznLuqbs8WC1fbkWAVdlfahgo8iw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1730336392; x=1730422792; bh=yA3hYcLMpo7PVYQOnHOPfmnXU3c2xRezzDJ YDtweEEQ=; b=CMvPAWxMuiEHFSWwYLuOqmN/FnWznkWki/pwhSr4R0JCMOd3pPr VxtKaiv1HZDw3XiYxxBjbI8L4njBCRSoxXhUe7lddFgpVRigLKZ9l+svJ5oKqBuA N1gpiicSlo7mEC18ZsOyaa/ghve4/AgkGsmNf8HC2H+T0qcJMDJ4eCaaYfArsgNB acp2wiGOebdxTiTK55PtLA3idqgLhc2zKuH3NRsXyjhxpe3gNNdJ5wsJ0aklGwOW /MphfeDM81Ha2EHtoif6zwmjClvGbTtEbZfAZ5gz+1lQyU8+f4VDZljKZgJKb8Ga Jg4Pc1OhqjQ10F7Lf46T96JyJ18dz/P6y8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdekgedgvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhf gggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruc eomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteel ieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepshhmihhthhhpsgdvvdehtdesghhmrghilhdrtghomhdprhgtphht thhopegsvghrthhrrghnuggurhhouhhvohhtrdhpghesghhmrghilhdrtghomhdprhgtph htthhopehpvghtvghrsegvihhsvghnthhrrghuthdrohhrghdprhgtphhtthhopehhlhhi nhhnrghkrgesihhkihdrfhhipdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslh hishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 30 Oct 2024 20:59:50 -0400 (EDT) Date: Thu, 31 Oct 2024 09:59:35 +0900 From: Michael Paquier To: Peter Smith Cc: Bertrand Drouvot , Peter Eisentraut , Heikki Linnakangas , pgsql-hackers@lists.postgresql.org Subject: Re: define pg_structiszero(addr, s, r) Message-ID: References: <3023d29e-0fe7-4bec-9028-7f3c0102e437@eisentraut.org> <36371fab-f90c-427c-9c14-210e93e9cd12@eisentraut.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="auMJ8MGb8xmoDF+U" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --auMJ8MGb8xmoDF+U Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 31, 2024 at 07:55:45AM +1100, Peter Smith wrote: > +/* > + * Test if a memory region starting at p and of size len is full of zero= es. > + */ > +static inline bool > +pg_mem_is_all_zeros(const void *ptr, size_t len) >=20 > The function comment should say 'ptr' instead of 'p', right? Yes. +static inline bool +pg_mem_is_all_zeros(const void *ptr, size_t len) While we're talking about wordsmithing things, I would not choose "mem" for this routine, just stick to "memory". There is not much in the code that does memory-specific things like what you are proposing here. Still, this would be more consistent with the macros for memory=20 barriers at least. Hence, "pg_memory_is_all_zeros()" makes more sense? The location of memutils.h is sensible. + if (pg_mem_is_all_zeros(pagebytes , (BLCKSZ / sizeof(size_t)))) Extra space not required after pagebytes. -- Michael --auMJ8MGb8xmoDF+U Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmci1ncACgkQnvQgOdby QH0WCg//errYUDAslcUOOIshCqrZgCBpgac07mSXW6UoT7cUOntxdjuo08zSavy7 v4TK0Ppb6ouS+3bPaH0gWvNiGEW3mEDZ/VSumgUa03PUR0D/tueUuPzWH2WDS6zU zDEERtq2+DXTGPfJER+TPMzEFg4kr8X7iIwXOVZossU5eQvTFfjSSDUZ2/kB9T4Q c9HhKbctEyb4cHH+0NXWdzwlCEkK0xC4gi7r7gA5G+AnN09kjs7HfxBJD3TTF4zj cxClqAaSrw9YdAiPVr/pdLso2NQGo/vQ0L2pmRl8jDifvhfCF/KG041WAGGB5wK0 VNhowAY7VZt+U2THOinb9hNpdnxLbQu04N+Dl6gdGwgp4uxjJE/0mT/e4VqWSf98 di3Jc9ErHSf+Ob2DxZbYb41qpL5LSx0qeW3rK3TdfBUJQTSKiOVXW03vQFc+SOfS +WQ2YYUs8tE1O8keEx5JzqxDSqMzYOJwGolIJex0a/MIwN3lp+vCYorv/9ghNdc0 PjN48hmdCUOA6C1fhimPeKCHK6sVrWMb5v/R5lHJ27kqqsJ1opDsicWazVtbhti9 5PdtJZBf1RzfCdA3h08Ww+B1fTdz5WcUxNUEht5T4GxFbUrjxwZrHFfw609nt4Na j7Bs7G4pINNnqETNJdugP5NAht/fJSyElhTIapNman22QuqXJcI= =+IkL -----END PGP SIGNATURE----- --auMJ8MGb8xmoDF+U--