Re: Memory management question

Поиск
Список
Период
Сортировка
От Gavin Sherry
Тема Re: Memory management question
Дата
Msg-id Pine.LNX.4.21.0209032151110.19407-100000@linuxworld.com.au
обсуждение исходный текст
Ответ на Memory management question  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Список pgsql-hackers
On Tue, 3 Sep 2002, Nigel J. Andrews wrote:

> 
> 
> It's probably a pretty basic question explained in some document I haven't seen
> but...if I do something like a CreateTupleDescCopy() how do I know my memory
> context owns everything allocated without following the code all the way
> through until it returns to me?

Umm.. how else could you *really* know unless you read the
source? Basically, all convenience routines off this nature allow memory
in the current memory context.

As for CreateTupleDescCopy() you don't have to look too far to see what it
does:

--

CreateTupleDescCopy(TupleDesc tupdesc)
{   TupleDesc   desc;   int         i,               size;
   desc = (TupleDesc) palloc(sizeof(struct tupleDesc));

--

Gavin



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

Предыдущее
От: "Nigel J. Andrews"
Дата:
Сообщение: Memory management question
Следующее
От: Karel Zak
Дата:
Сообщение: Re: Memory management question