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

Поиск
Список
Период
Сортировка
От Christof Petig
Тема Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Дата
Msg-id 3CD632AE.30000@petig-baender.de
обсуждение исходный текст
Ответ на ECPG: FETCH ALL|n FROM cursor - Memory allocation?  (Lee Kindness <lkindness@csl.co.uk>)
Ответы Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Re: [INTERFACES] ECPG: FETCH ALL|n FROM cursor - Memory allocation?
Список pgsql-hackers
Michael Meskes wrote:
> On Thu, Apr 25, 2002 at 12:42:00PM +0100, Lee Kindness wrote:
>>Should the input pointers be NULL initialised? How should the memory
>>be freed?
> 
> 
> A simple free() will do. You also can free all automatically
> allocated memory from the most recent executed statement by calling
> ECPGfree_auto_mem(). But this is not documented and will never be.
> 
> The correct way is to free(array1) and free(array2) while libecpg will
> free the internal structures when the next statement is executed.

Never, never mix these two! ECPGfree_auto_mem will free even memory 
which has already been free'd by the user, perhaps we should get rid of 
this method (any allocated memory regions are stored in a list, if you 
never call ECPGfree_auto_mem, this list grows and grows).
   Christof



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

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: Musings
Следующее
От: Christof Petig
Дата:
Сообщение: Re: HEADS UP: Win32/OS2/BeOS native ports