public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ranier Vilela <[email protected]>
To: Dean Rasheed <[email protected]>
Cc: Pg Hackers <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: David Rowley <[email protected]>
Cc: John Naylor <[email protected]>
Cc: Tom Lane <[email protected]>
Subject: Re: Non-decimal integer literals
Date: Tue, 24 Jan 2023 07:34:19 -0300
Message-ID: <CAEudQAp7u7q=WBxhcEvpZt67LaHWMKNGL57FP3DoG84uT0embw@mail.gmail.com> (raw)
In-Reply-To: <CAEZATCWE5udJVtQn6JJez8t+4ERgy1Fqj7x+T8qGMN6KfKUYow@mail.gmail.com>
References: <CAEudQAqGdfrh7TDQUAjeOHVKiE0b6M3vZv-+U4X-5Yvum4rDFg@mail.gmail.com>
	<CAEZATCWE5udJVtQn6JJez8t+4ERgy1Fqj7x+T8qGMN6KfKUYow@mail.gmail.com>

Em ter., 24 de jan. de 2023 às 07:24, Dean Rasheed <[email protected]>
escreveu:

> On Tue, 24 Jan 2023 at 00:47, Ranier Vilela <[email protected]> wrote:
> >
> > On 13.01.23 11:01, Dean Rasheed wrote:
> > > So I'm feeling quite good about the end result -- I set out hoping not
> > > to make performance noticeably worse, but ended up making it
> > > significantly better.
> > Hi Dean, thanks for your work.
> >
> > But since PG_RETURN_NULL, is a simple return,
> > now the "value" var is not leaked?
> >
>
> That originates from a prior commit:
>
> ccff2d20ed Convert a few datatype input functions to use "soft" error
> reporting.
>
> and see also a bunch of follow-on commits for other input functions.
>
> It will only return NULL if the input is invalid and escontext is
> non-NULL. You only identified a fraction of the cases where that would
> happen. If we really cared about not leaking memory for invalid
> inputs, we'd have to look at every code path using ereturn()
> (including lower-level functions, and not just in numeric.c). I think
> that would be a waste of time, and counterproductive -- trying to
> immediately free memory for all possible invalid inputs would likely
> complicate a lot of code, and slow down parsing of valid inputs.
> Better to leave it until the owning memory context is freed.
>
Thank you for the explanation.

regards,
Ranier Vilela


view thread (3+ messages)

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], [email protected], [email protected]
  Subject: Re: Non-decimal integer literals
  In-Reply-To: <CAEudQAp7u7q=WBxhcEvpZt67LaHWMKNGL57FP3DoG84uT0embw@mail.gmail.com>

* 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