Re: Use stack allocated StringInfoDatas, where possible (round 2)

David Rowley <dgrowleyml@gmail.com>

From: David Rowley <dgrowleyml@gmail.com>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-04-12T22:45:37Z
Lists: pgsql-hackers
On Mon, 13 Apr 2026 at 01:34, David Rowley <dgrowleyml@gmail.com> wrote:
> I think the author of copy_sequences() doesn't know what
> resetStringInfo() does. I expect they think that it'll pfree all the
> memory, but that's what destroyStringInfo() is for.

That was poor analysis. The resetStringInfo is there to reset the
StringInfo before the next loop. So nothing is wrong with it.

I've now pushed your patch.

David



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Use stack-allocated StringInfoDatas, where possible

  2. Use stack allocated StringInfoDatas, where possible