public inbox for [email protected]  
help / color / mirror / Atom feed
From: Daniel Gustafsson <[email protected]>
To: Jacob Champion <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: PostgreSQL Developers <[email protected]>
Subject: Re: jsonapi: scary new warnings with LTO enabled
Date: Mon, 21 Apr 2025 20:20:00 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAOYmi+=w3Q-3F=LCr9hPRhiG2HGv6sogGOJW3v9pwpoCD6wN+w@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAOYmi+n+DHpaEV5hymhufutTgc+S=+pDQfXEUi4hMAV1eO8aTw@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAOYmi+mxjW0GhSGPKoOy3TYrFcdTM=5FcUn=u1i7CFhb2303Zg@mail.gmail.com>
	<[email protected]>
	<CAOYmi+=w3Q-3F=LCr9hPRhiG2HGv6sogGOJW3v9pwpoCD6wN+w@mail.gmail.com>

> On 21 Apr 2025, at 17:33, Jacob Champion <[email protected]> wrote:
> 
> On Sat, Apr 19, 2025 at 2:15 PM Daniel Gustafsson <[email protected]> wrote:
>> Since there is no way to determine if the allocation succeeded from outside of
>> the JSON api it might be better to keep the calloc and explicitly free it?
> 
> I don't think so; pg_parse_json() will error out quickly, so I don't
> see much advantage to the extra code. Raw performance isn't much of a
> concern for the out-of-memory case, IMO.

Sure, but I fear we'll get an endless stream of static analysis reports for the
allocation leaking if we don't free it.

--
Daniel Gustafsson






view thread (12+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: jsonapi: scary new warnings with LTO enabled
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox