Re: Storing MemoryContext Pointers

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

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, ...)

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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Woodward 2006-10-05 19:46:18 Upgrading a database dump/restore
Previous Message Mark Woodward 2006-10-05 19:23:44 Re: Query Failed, out of memory