Minor refactorings to eliminate some static buffers

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Minor refactorings to eliminate some static buffers
Date: 2024-07-30 11:22:19
Message-ID: 7f86e06a-98c5-4ce3-8ec9-3885c8de0358@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

--
Heikki Linnakangas
Neon (https://neon.tech)

Attachment Content-Type Size
v1-0001-Replace-static-bufs-with-StringInfo-in-cash_words.patch text/x-patch 5.1 KB
v1-0002-Replace-static-buf-with-palloc-in-str_time.patch text/x-patch 994 bytes
v1-0003-Replace-static-buf-with-a-stack-allocated-one-in-.patch text/x-patch 763 bytes
v1-0004-Replace-static-buf-with-a-stack-allocated-one-in-.patch text/x-patch 1.8 KB
v1-0005-Refactor-getWeights-to-write-to-caller-supplied-b.patch text/x-patch 5.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2024-07-30 11:24:04 PG17beta2: SMGR: inconsistent type for nblocks
Previous Message Thomas Munro 2024-07-30 11:08:36 Re: Remove last traces of HPPA support