Re: Memory management question - Mailing list pgsql-hackers

From Gavin Sherry
Subject Re: Memory management question
Date
Msg-id Pine.LNX.4.21.0209032151110.19407-100000@linuxworld.com.au
Whole thread Raw
In response to Memory management question  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
List 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 by date:

Previous
From: "Nigel J. Andrews"
Date:
Subject: Memory management question
Next
From: Karel Zak
Date:
Subject: Re: Memory management question