Re: Add support for __attribute__((returns_nonnull))

From: "Tristan Partin" <tristan(at)neon(dot)tech>
To: "John Naylor" <johncnaylorls(at)gmail(dot)com>
Cc: "Peter Eisentraut" <peter(at)eisentraut(dot)org>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add support for __attribute__((returns_nonnull))
Date: 2024-01-08 23:04:58
Message-ID: CY9P8WL3DJ87.3B0G45F2WDPZM@neon.tech
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)neon(dot)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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tristan Partin 2024-01-08 23:31:37 Re: Make psql ignore trailing semicolons in \sf, \ef, etc
Previous Message Jelte Fennema-Nio 2024-01-08 22:51:53 Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs