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.96) (envelope-from ) id 1whFfM-0006fJ-2j for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 23:57:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whFfL-003Zcr-0N for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 23:57:27 +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.96) (envelope-from ) id 1whFfK-003Zcg-1v for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 23:57:27 +0000 Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whFfJ-0000000041r-0R0g for pgsql-hackers@postgresql.org; Tue, 07 Jul 2026 23:57:26 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 38DC71D0008A; Tue, 7 Jul 2026 19:57:24 -0400 (EDT) Received: from phl-imap-15 ([10.202.2.104]) by phl-compute-05.internal (MEProxy); Tue, 07 Jul 2026 19:57:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=partin.io; h=cc :cc:content-transfer-encoding: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=fm2; t=1783468644; x=1783555044; bh=1HZlPV8AwxmL/0Rj0DmLjg7CSCzwEoFV1BtL90U8fBM=; b= CB0KnWdkESCsNQu+GdAQNS5sxWwV+7zx/LehA3D/87RrhCCJPClQrrv9/FWk7MFt Sj8ruHJ9WNkZUWvozJhsIAn2cSRa7AG5VOdAKkCfG8zxI2VbvSKzAOJIKtkXHqso eWz5QpPNSghRcVLmbSX62aCe3vYpwFOd0RefGq420Gc0xZ4l6NbcXCwZ7o4CA7W5 QLN5Z2gWmhrPYws7fvUR/1NRxwALYLqGr5I7RWoVmz1VaMOwzIGAkI2DfmTKSCmM nV9aJsPC6KZWI2O3yJBLfqZiASTYg+Ag5z+LvBkz7lwews4XdeJzx6lZ9oQPlK02 0Z6KQwPnWfXYrC4uiq4A0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=fm2; t=1783468644; x= 1783555044; bh=1HZlPV8AwxmL/0Rj0DmLjg7CSCzwEoFV1BtL90U8fBM=; b=A jjw+kO3lsvxF/hDUmC8FgEtPKiPpqZiNUjnduEapuKcDJRhrebmJjHiS8WA8dJq3 uiSD+K02Fh2nBD5hW8+JJOM10ItSIbaApBtDsXTkjU0zM0Z23Kv6/1cdKrwpIPRx HJnPhg0Gpjo8TzJowbNJM4KlP9uPCL5x950SV20jsUBjjbIEODPJMaVYgqXOGO61 Qi0yBfTxRXpBgKzTdCD7wUC+Q/shnfk5nsKwkLzcyUBlRNxvL6NMvSWHlCGoxWD5 dG1Mkt8h4j7rqwzN1ptuMoxiYlxalzRU0WYVM1a1a9l7h147iyHCPsJrSecwH1PF 2rqT4yu05RUSyMfi8hdew== X-ME-Sender: X-ME-Proxy-Cause: dmFkZTFt98dasVhyZy0AKsV3X3BP8hWDYAolsUEb2EKhK28xeS//Q2IxkvQUh8MXPVJXU0 OlofHZCBr0tmNEVfJ0YBLIEZYfd6eNaAsUZC7Urhy8JvuRcajetuoTuWFnLw4TRZD24knw EYqhyej/ltFMLdrdnZWyiWExwDqYEwknZ6ENahZfhLAQZdFDkdQsQbY5Q+tw0Fih+fCYbj KNZo8HlR/l0LrxN3g17lnZ/2AmJ/xB/LxEaRzs6Jjx+i7bsqbtkhfnA5gsrW68GZleERtq tnzYV9PXryMMinHUGgtc1B/FjrYXDuMLHuBnPJqGQ6IKwXcTtGRokjqVv0vj3maLLgrvNi Df/MVg82FfgqLMGBvUIlc3HfxquRtDGByvS+37uFmUtO57NX24ufTaMUwBJLfXZq3bnuNX 1xIDTUq8jx5vvIrUDrOVD3kmaKlMYpiXNjCiistKfnpqSeARuxL8ByhrNfSsg5i255utPg 1UhcW4aHKYwE92VHmtr0x6keqI8wO7lbAr+sa2bdHMfccidjNXoBnjiLNZ7uwOChyKe4tn 4jJjv6BS/Wv+pcxxEekFQ6EipT4OTGOucssXDqkATEqBEIxXfD+DW7x9BaU32e0Qk0U0yJ nv/1MLUbGyYjX9r4jXCj94YC8eSuaay1DueKgYebMYcLbDRNY1zwlOuBzU1w X-ME-Proxy: Feedback-ID: idd01497b:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id B119F780AB5; Tue, 7 Jul 2026 19:57:23 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 07 Jul 2026 23:57:23 +0000 Message-Id: From: "Tristan Partin" Cc: "Peter Eisentraut" , "pgsql-hackers" Subject: Re: Add malloc attribute to memory allocation functions To: "Tom Lane" , "Michael Paquier" X-Mailer: aerc 0.21.0 References: <924283.1783312014@sss.pgh.pa.us> <2248c1c4-68f7-46dc-9e58-9ba9057da74e@eisentraut.org> <1847455.1783439616@sss.pgh.pa.us> <1885662.1783468446@sss.pgh.pa.us> In-Reply-To: <1885662.1783468446@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue Jul 7, 2026 at 6:54 PM CDT, Tom Lane wrote: > Michael Paquier writes: >> Additional question. Does this help with requirements like the one >> listed in fe-exec.c for PQfreemem() under WIN32? > > Yeah, I was wondering about that point too. It would be really nice > to have automated checks for that. Maybe the right thing to do here > (to start anyway) is to put in targeted annotations that address > specific pain points like that one. > > One issue that'd have to be dealt with is that that would involve > putting annotations into the public header file libpq-fe.h. We'd need > to be sure we do not break things for applications using compilers > other than what we built libpq with. That seems reasonably easy to do > with some macro trickery, but it's a point to keep in mind. Ok, I think the path forward is two-fold: 1. Add the annotations to specific pain points as Tom suggested=20 (PGfreemem(), frontend memory allocators) 2. Add the annotations to the backend allocators knowing that the patch=20 may not be committed --=20 Tristan Partin PostgreSQL Contributors Team AWS (https://aws.amazon.com)