RE: make MaxBackends available in _PG_init - Mailing list pgsql-hackers

From wangsh.fnst@fujitsu.com
Subject RE: make MaxBackends available in _PG_init
Date
Msg-id OSBPR01MB42140A01E3441C576539AF38F2FC9@OSBPR01MB4214.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: make MaxBackends available in _PG_init  (Greg Sabino Mullane <htamfids@gmail.com>)
Responses Re: make MaxBackends available in _PG_init
List pgsql-hackers
Hi,

I noticed that in v3-0001-Disallow-external-access-to-MaxBackends.patch, there are some modifications like:

> -        for (int i = 0; i <= MaxBackends; i++)
> +        for (int i = 0; i <= GetMaxBackends(); i++)

I don't think calling function GetMaxBackends() in the for loop is a good idea.  
How about use a temp variable to save the return value of function GetMaxBackends() ?

Regards,
Shenhao Wang

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ECPG bug fix: DECALRE STATEMENT and DEALLOCATE, DESCRIBE
Next
From: otar shavadze
Date:
Subject: Get table total page quantity and cached page quantity