Re: Storing MemoryContext Pointers

From: Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Storing MemoryContext Pointers
Date: 2006-10-06 07:43:18
Message-ID: 20061006074318.GA1375@alamut
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Oct 05 03:34, Tom Lane wrote:
> Volkan YAZICI <yazicivo(at)ttnet(dot)net(dot)tr> writes:
> > When I allocate a new memory context via
>
> > oldmcxt = AllocSetContextCreate(TopMemoryContext, ...)
> > persistent_mcxt = CurrentMemoryContext;
>
> ITYM
>
> persistent_mcxt = AllocSetContextCreate(TopMemoryContext, ...)

Opps! Right. (I was looking at some MemoryContextSwitchTo() code while
typing above lines.)

> because the other doesn't do what you think...
>
> > How can I store the persistent_mcxt in a persistent place that I'll be
> > able to reach it in my next getting invoked?
>
> Make it a static variable.

I had thought some kind of fcinfo->flinfo->fn_extra trick but... a
static variable is fair enough too.

Thanks so much for the answer (also for your reply to caching subjected
post).

Regards.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paesold 2006-10-06 07:47:45 Re: continuing daily testing of dbt2 against postgresql
Previous Message Andrew Dunstan 2006-10-06 07:35:55 Re: timestamptz alias