Re: Add malloc attribute to memory allocation functions
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Peter Eisentraut <peter@eisentraut.org>,
Tristan Partin <tristan@partin.io>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-07-07T23:54:06Z
Lists: pgsql-hackers
Michael Paquier <michael@paquier.xyz> 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