On Wed, 29 Jun 2022 at 12:59, David Rowley <dgrowleyml@gmail.com> wrote:
> I noticed while doing some memory context related work that since we
> now use generation.c memory contexts for tuplesorts (40af10b57) that
> tuplesort_putindextuplevalues() causes memory "leaks" in the
> generation context due to index_form_tuple() being called while we're
> switched into the state->tuplecontext.
I voiced my dislike for the patch I came up with to fix this issue to
Andres. He suggested that I just add a version of index_form_tuple
that can be given a MemoryContext pointer to allocate the returned
tuple into.
I like that idea much better, so I've attached a patch to fix it that way.
If there are no objections, I plan to push this in the next 24 hours.
David