Re: ECPG: FETCH ALL|n FROM cursor - Memory allocation?

Поиск
Список
Период
Сортировка
От Christof Petig
Тема Re: ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Дата
Msg-id 3CD67B63.8090304@petig-baender.de
обсуждение исходный текст
Ответ на ECPG: FETCH ALL|n FROM cursor - Memory allocation?  (Lee Kindness <lkindness@csl.co.uk>)
Список pgsql-interfaces
Lee Kindness wrote:
> Okay, lets see if i've got this right...
> 
> If I allocate the memory before the FETCH then I (naturally) free
> it. However If I NULL initialise the pointer then libecpg will
> allocate the memory and I must NOT free it - libecpg will free it
> automatically... Yeah?

No, I only said: Never mix free and ECPGfree_auto_mem because 
ECPGfree_auto_mem will double free it if you free'd it already.

And also: it might be a good idea to kill the undocumented function (and 
the list).

And: You need to free it (by one of the two methods above).

> 
> I think this highlights the need for some documentation on this
> aspect.

Yes it does.
  Christof



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

Предыдущее
От: "Leslie Herps"
Дата:
Сообщение: [ERROR] pgsql_perl5
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Using C functions with triggers