Re: MAX_BACKENDS size (comment accuracy)

From: Jacob Brazeal <jacob(dot)brazeal(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: MAX_BACKENDS size (comment accuracy)
Date: 2025-01-26 20:57:50
Message-ID: CA+COZaDH=axxc0x=uXdtjsY+Hz1ktLsTO6+He649UUwGQHNBNQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Looking at v1-0003-WIP-Base-LWLock-limits-directly-on-MAX_BACKENDS.patch,
I'm curious about the following assert;

> #define LW_VAL_EXCLUSIVE (MAX_BACKENDS + 1)
...
> StaticAssertDecl(MAX_BACKENDS < LW_VAL_EXCLUSIVE,
"MAX_BACKENDS too big for lwlock.c");

Since LW_VAL_EXCLUSIVE is already defined as MAX_BACKENDS + 1, is this
basically just checking for an integer overflow?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Brazeal 2025-01-26 21:08:19 Re: MAX_BACKENDS size (comment accuracy)
Previous Message Jacob Brazeal 2025-01-26 20:55:15 Re: MAX_BACKENDS size (comment accuracy)