Re: Missing pfree in logical_heap_rewrite_flush_mappings() - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Missing pfree in logical_heap_rewrite_flush_mappings()
Date
Msg-id 20140327121905.GH4582@tamriel.snowman.net
Whole thread Raw
In response to Re: Missing pfree in logical_heap_rewrite_flush_mappings()  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
* Andres Freund (andres@2ndquadrant.com) wrote:
> On 2014-03-26 13:41:27 -0400, Stephen Frost wrote:
> > > Good catch. There's actually no need for explicitly using the context,
> > > we're in the appropriate one. The only other MemoryContextAlloc() caller
> > > in there should be converted to a palloc as well.
> >
> > Hrm..?  I don't think that's right when it's called from
> > end_heap_rewrite().
>
> You're right. Apprently I shouldn't look at patches while watching a
> keynote ;)

No problem- but that's also why I was thinking we should just wrap
end_heap_rewrite() in a context as well, otherwise the next person who
comes along to add a bit of code here may end up making the same
mistake.  Is there something you're concerned about there?

> > Perhaps we should be switching to state->rs_cxt
> > while in end_heap_rewrite() also though?
>
> I think just applying Aant's patch is fine.

I have no problem *also* doing the pfree() to address the concern about
the transient memory usage being more than we'd like.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: datistemplate of pg_database does not behave as per description in documentation
Next
From: Etsuro Fujita
Date:
Subject: Re: inherit support for foreign tables