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 1tiGSK-00DeS3-Tn for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Feb 2025 17:23:24 +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 1tiGSI-00BNsi-LV for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Feb 2025 17:23:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tiGSI-00BNsa-CI for pgsql-hackers@lists.postgresql.org; Wed, 12 Feb 2025 17:23:23 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tiGSG-000To5-2i for pgsql-hackers@postgresql.org; Wed, 12 Feb 2025 17:23:22 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 51CHNHun3355448; Wed, 12 Feb 2025 12:23:17 -0500 From: Tom Lane To: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= cc: Andres Freund , Euler Taveira , "ranier.vf@gmail.com" , pgsql-hackers Subject: Re: Small memory fixes for pg_createsubcriber In-reply-to: <878qqb2ibm.fsf@wibble.ilmari.org> References: <68d6d810-4ef1-4f62-b47f-89b21501249b@app.fastmail.com> <3337507.1739376124@sss.pgh.pa.us> <878qqb2ibm.fsf@wibble.ilmari.org> Comments: In-reply-to =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= message dated "Wed, 12 Feb 2025 17:17:49 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3355446.1739380997.1@sss.pgh.pa.us> Date: Wed, 12 Feb 2025 12:23:17 -0500 Message-ID: <3355447.1739380997@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= writes: > Andres Freund writes: >> Particularly for something like libpq it's not quitetrivial to add >> attributes like this, of course. We can't even depend on pg_config.h. >> One way would be to define them in libpq-fe.h, guarded by an #ifdef, that's >> "armed" by a commandline -D flag, if the compiler is supported? > Does it need a -D flag, wouldn't __has_attribute(malloc) (with the > fallback definition in c.h) be enough? libpq-fe.h has to be compilable by application code that has never heard of pg_config.h let alone c.h, so we'd have to tread carefully about not breaking that property. But it seems like this would be worth looking into. regards, tom lane