Re: Memory management question

From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
To: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Memory management question
Date: 2002-09-03 11:53:27
Message-ID: Pine.LNX.4.21.0209032151110.19407-100000@linuxworld.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2002-09-03 11:57:54 Re: possible vacuum improvement?
Previous Message Karel Zak 2002-09-03 11:52:09 Re: Memory management question