Re: Exporting closePGconn from libpq

Поиск
Список
Период
Сортировка
От Markus Wanner
Тема Re: Exporting closePGconn from libpq
Дата
Msg-id 4DD0E462.8010406@bluegap.ch
обсуждение исходный текст
Ответ на Exporting closePGconn from libpq  (Leon Smith <leon.p.smith@gmail.com>)
Список pgsql-hackers
Leon,

On 05/14/2011 05:23 PM, Leon Smith wrote:
> A minor issue has come up in creating low-level bindings to libpq for
> safe garbage-collected languages,  namely that PQfinish is the only
> (AFAICT) way to close a connection but also de-allocates the memory
> used to represent the database connection.    It would be preferable
> to call PQfinish to free the memory in a finalizer,  but appilcations
> need a way to disconnect from the database at a predictable and
> deterministic point in time,  whereas leaving a bit of memory around
> until the GC finally gets to it is relatively harmless.

It's harmless, but I think it's also useless.  Or why do you want to
keep that (libpq-private) bit of memory around beyond PQfinish()?

I'm not sure what language or VM you have in mind, but your description
sounds like you are writing a wrapper by definition.

Regards

Markus Wanner


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Isolation checks under MSVC
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Exporting closePGconn from libpq