Re: WIP: pl/pgsql cleanup - Mailing list pgsql-patches

From Neil Conway
Subject Re: WIP: pl/pgsql cleanup
Date
Msg-id 1107820615.1286.52.camel@localhost.localdomain
Whole thread Raw
In response to Re: WIP: pl/pgsql cleanup  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: WIP: pl/pgsql cleanup  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Mon, 2005-02-07 at 10:41 -0500, Tom Lane wrote:
> My recollection is that I was not nearly as worried about short-term
> pallocs in the plpgsql code itself, as about leakage in various main-
> backend routines that get called incidentally during parsing.
> backend/parser/ is quite cavalier about this as a whole, because it
> expects to be called in contexts that are not long-lived.

Hmmm. What about switching the CurrentMemoryContext to the function's
long-lived context when we invoke plpgsql_yyparse(), but keeping it as
the short-lived context during the rest of the compilation process? This
unfortunately complicates the memory management model still further, but
it should significantly reduce the chance of any memory leaks.

-Neil



pgsql-patches by date:

Previous
From: Guillaume LELARGE
Date:
Subject: Updated french translations
Next
From: Tom Lane
Date:
Subject: Re: WIP: pl/pgsql cleanup