Re: Avoid overflow with simplehash - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Avoid overflow with simplehash
Date
Msg-id 1215055.1688658408@sss.pgh.pa.us
Whole thread Raw
In response to Re: Avoid overflow with simplehash  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2023-07-06 11:16:26 -0400, Tom Lane wrote:
>> It does seem like we could do
>>     uint64        startelem = SH_MAX_SIZE;
>>     ...
>>     Assert(startelem < SH_MAX_SIZE);
>> which'd make it a little clearer that the expectation is for
>> startelem to have changed value.

> I guess? I find it easier to understand all-bits-set in a coredump as
> too-large than SH_MAX_SIZE, but ...

What'd help even more is a comment:

    /* We should have found an empty element */
    Assert(startelem < SH_MAX_SIZE);

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Problems with estimating OR conditions, IS NULL on LEFT JOINs
Next
From: Andrew Dunstan
Date:
Subject: Re: pgindent vs. pgperltidy command-line arguments