Re: Add support for __attribute__((returns_nonnull)) - Mailing list pgsql-hackers

From Tristan Partin
Subject Re: Add support for __attribute__((returns_nonnull))
Date
Msg-id CY9P8WL3DJ87.3B0G45F2WDPZM@neon.tech
Whole thread Raw
In response to Re: Add support for __attribute__((returns_nonnull))  (John Naylor <johncnaylorls@gmail.com>)
Responses Re: Add support for __attribute__((returns_nonnull))
List pgsql-hackers
On Sun Dec 31, 2023 at 9:29 PM CST, John Naylor wrote:
> On Thu, Dec 28, 2023 at 1:20 AM Tristan Partin <tristan@neon.tech> wrote:
> > I recently wound up in a situation where I was checking for NULL return
> > values of a function that couldn't ever return NULL because the
> > inability to allocate memory was always elog(ERROR)ed (aborted).
>
> It sounds like you have a ready example to test, so what happens with the patch?
>
> As for whether any code generation changed, I'd start by checking if
> anything in a non-debug binary changed at all.

The idea I had in mind initially was PGLC_localeconv(), but I couldn't
prove that anything changed with the annotation added. The second patch
in my previous email was attempt at deriving real-world benefit, but
nothing I did seemed to change anything. Perhaps you can test it and see
if anything changes for you.

--
Tristan Partin
Neon (https://neon.tech)



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs
Next
From: "Tristan Partin"
Date:
Subject: Re: Make psql ignore trailing semicolons in \sf, \ef, etc