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 1whFcF-0006cN-1L for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 23:54:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1whFcC-003XZD-2R for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jul 2026 23:54:13 +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 1whFcC-003XZ1-1W for pgsql-hackers@lists.postgresql.org; Tue, 07 Jul 2026 23:54:13 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1whFcB-000000003ze-0MaP for pgsql-hackers@postgresql.org; Tue, 07 Jul 2026 23:54:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 667Ns6XE1885663; Tue, 7 Jul 2026 19:54:06 -0400 From: Tom Lane To: Michael Paquier cc: Peter Eisentraut , Tristan Partin , pgsql-hackers Subject: Re: Add malloc attribute to memory allocation functions In-reply-to: References: <924283.1783312014@sss.pgh.pa.us> <2248c1c4-68f7-46dc-9e58-9ba9057da74e@eisentraut.org> <1847455.1783439616@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Wed, 08 Jul 2026 07:58:14 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1885661.1783468446.1@sss.pgh.pa.us> Date: Tue, 07 Jul 2026 19:54:06 -0400 Message-ID: <1885662.1783468446@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. regards, tom lane