Skip site navigation (1) Skip section navigation (2)

Re: Memory-context slinging

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Memory-context slinging
Date: 2000-07-04 19:57:37
Message-ID: Pine.LNX.4.21.0007042111030.3542-100000@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
Tom Lane writes:

> If you really truly want a context that's destroyed by elog(ERROR),
> and not by any other event, then create it as a child of ErrorContext,
> and that's what will happen.  But I suspect what you really want is a
> context that's a child of TopTransactionContext and will go away at
> either transaction commit or transaction abort.

No, actually I wanted the former. Notice how the configuration file is
first read in completely as a linked list. When something goes wrong
(garbage in the file) I need to free the list (and other things) before
calling elog. The alternative would be to create a separate memory context
for this processing, but that's more of a purity issue, it wouldn't make
it work better, AFAICT.

> A difficulty I have been noticing with some of these special-purpose
> contexts is that you'd like to keep a pointer to them in some global
> variable, but there's no easy way to determine whether that pointer is
> currently valid

Shouldn't it be NULL if it's not valid?


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e(at)gmx(dot)net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


In response to

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2000-07-04 19:57:52
Subject: Dumping SQL type names
Previous:From: Peter EisentrautDate: 2000-07-04 19:57:31
Subject: zlib for pg_dump

pgsql-committers by date

Next:From: Peter EisentrautDate: 2000-07-04 19:58:06
Subject: Re: [COMMITTERS] pgsql/doc/TODO.detail (alpha default distinct flock fsync function limit null pg_shadow primary)
Previous:From: Peter Eisentraut - PostgreSQLDate: 2000-07-04 19:52:01
Subject: pgsql/src/bin/pg_dump (Makefile)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group