Skip site navigation (1) Skip section navigation (2)

libpq docs about PQfreemem

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: libpq docs about PQfreemem
Date: 2007-02-04 09:57:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
have this about PQfreemem():

Frees memory allocated by <application>libpq</>, particularly
   and <function>PQnotifies</function>.
   It is needed by Microsoft Windows, which cannot free memory across
   DLLs, unless multithreaded DLLs (<option>/MD</option> in VC6) are used.
   On other platforms, this function is the same as the standard library
function <function>free()</>.

That's also a very old comment, dating back to when we could build libpq
with VC6 only and nothing else. Now we can build with MinGW, Borland,
VC2005 and I think also VC2003. Which would add the note that this is
also depending on *which compiler* and *which compiler version*.
The /MD mention is just one of several different options to select the
runtime libraries, so it seems really misplaced.

Now, there are two options for this. Either we fix it (I can put
together a patch), or we remove it altogether. To me, it seems to be
just an implementation detail and some kind of explanation why we're
doing it - which would live better in a source code comment than in the
This includes the part about how it's just the same as free() on other
platforms. That's just an implementation detail, and I assume we don't
want people to rely on that - in case we ever want to change it in the
future for some reason. (the doc for the other functions say you have to
use PQfreemem without mentioning any exceptions)

Thoughts? Rip out or update?



pgsql-hackers by date

Next:From: Peter EisentrautDate: 2007-02-04 11:44:06
Subject: Re: Re: [COMMITTERS] pgsql: Add documentation for Windows on how to set an environment
Previous:From: Magnus HaganderDate: 2007-02-04 09:46:33
Subject: Re: [COMMITTERS] pgsql: Add documentation for Windows on how to set an environment

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group