Re: Minor refactorings to eliminate some static buffers
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-07-30T15:44:57Z
Lists: pgsql-hackers
On Tue, Jul 30, 2024 at 7:22 AM Heikki Linnakangas <hlinnaka@iki.fi> wrote: > As part of the multithreading work, it'd be nice to get rid of as many > global or static variables as possible. Remaining ones can be converted > to thread locals as appropriate, but where possible, it's better to just > get rid of them. > > Here are patches to get rid of a few static variables, by e.g. > converting them to regular local variables or palloc'd return values, as > appropriate. > > This doesn't move the needle much, but every little helps, and these > seem like nice little changes in any case. I spent a few minutes looking through these patches and they seem like good cleanups. I couldn't think of a plausible reason why someone would object to any of these. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Use psprintf to simplify gtsvectorout()
- 3ab2668d4847 18.0 landed
-
Constify fields and parameters in spell.c
- d5f139cb6814 18.0 landed
-
Mark misc static global variables as const
- fe8dd65bf28d 18.0 landed
-
Make nullSemAction const, add 'const' decorators to related functions
- 85829c973cb3 18.0 landed
-
Turn a few 'validnsps' static variables into locals
- 1e35951e71d3 18.0 landed
-
Refactor getWeights to write to caller-supplied buffer
- f822be39629c 18.0 landed
-
Replace static buf with a stack-allocated one in 'seg' extension
- 01e51ed78070 18.0 landed
-
Replace static buf with a stack-allocated one in ReadControlFile
- da8a587e2e22 18.0 landed
-
Replace static buf with palloc in str_time()
- 6151cb787613 18.0 landed
-
Replace static bufs with a StringInfo in cash_words()
- 5bf948d564e3 18.0 landed