pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use palloc_object() and palloc_array() in more areas of the tree
Date: Tue, 09 Dec 2025 05:53:54 +0000
Message-ID: <E1vSqfa-003ZDP-1N@gemulon.postgresql.org> (raw)

Use palloc_object() and palloc_array() in more areas of the tree

The idea is to encourage more the use of these new routines across the
tree, as these offer stronger type safety guarantees than palloc().

The following paths are included in this batch, treating all the areas
proposed by the author for the most trivial changes, except src/backend
(by far the largest batch):
src/bin/
src/common/
src/fe_utils/
src/include/
src/pl/
src/test/
src/tutorial/

Similar work has been done in 31d3847a37be.

The code compiles the same before and after this commit, with the
following exceptions due to changes in line numbers because some of the
new allocation formulas are shorter:
blkreftable.c
pgfnames.c
pl_exec.c

Author: David Geier <geidav.pg@gmail.com>
Discussion: https://postgr.es/m/ad0748d4-3080-436e-b0bc-ac8f86a3466a@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0c3c5c3b06a37c13a811ea93044202e06523b705

Modified Files
--------------
doc/src/sgml/gist.sgml                             |  8 +-
doc/src/sgml/xfunc.sgml                            |  2 +-
doc/src/sgml/xtypes.sgml                           |  2 +-
src/bin/pg_basebackup/astreamer_inject.c           |  2 +-
src/bin/pg_combinebackup/load_manifest.c           |  2 +-
src/bin/pg_dump/common.c                           |  2 +-
src/bin/pg_verifybackup/astreamer_verify.c         |  2 +-
src/bin/pg_verifybackup/pg_verifybackup.c          |  2 +-
src/bin/scripts/vacuuming.c                        |  2 +-
src/common/blkreftable.c                           | 21 +++--
src/common/parse_manifest.c                        |  4 +-
src/common/pgfnames.c                              |  5 +-
src/common/rmtree.c                                |  2 +-
src/common/stringinfo.c                            |  2 +-
src/fe_utils/astreamer_file.c                      |  4 +-
src/fe_utils/astreamer_gzip.c                      |  4 +-
src/fe_utils/astreamer_lz4.c                       |  4 +-
src/fe_utils/astreamer_tar.c                       |  6 +-
src/fe_utils/astreamer_zstd.c                      |  4 +-
src/include/lib/radixtree.h                        |  8 +-
src/pl/plperl/plperl.c                             | 12 +--
src/pl/plpgsql/src/pl_comp.c                       | 32 ++++----
src/pl/plpgsql/src/pl_exec.c                       |  9 +--
src/pl/plpgsql/src/pl_gram.y                       | 92 +++++++++++-----------
src/pl/plpython/plpy_procedure.c                   |  6 +-
src/pl/plpython/plpy_spi.c                         |  4 +-
src/pl/plpython/plpy_typeio.c                      | 12 +--
src/pl/tcl/pltcl.c                                 |  4 +-
src/test/modules/dummy_index_am/dummy_index_am.c   |  2 +-
src/test/modules/spgist_name_ops/spgist_name_ops.c | 10 +--
src/test/modules/test_bitmapset/test_bitmapset.c   |  2 +-
src/test/modules/test_integerset/test_integerset.c |  2 +-
.../test_json_parser_incremental.c                 |  2 +-
src/test/modules/test_parser/test_parser.c         |  4 +-
src/test/modules/test_radixtree/test_radixtree.c   |  2 +-
src/test/modules/test_regex/test_regex.c           | 14 ++--
.../modules/test_resowner/test_resowner_many.c     |  2 +-
src/test/modules/test_rls_hooks/test_rls_hooks.c   |  4 +-
src/test/modules/worker_spi/worker_spi.c           |  2 +-
src/test/regress/regress.c                         |  2 +-
src/timezone/pgtz.c                                |  2 +-
src/tutorial/complex.c                             |  6 +-
src/tutorial/funcs.c                               |  2 +-
43 files changed, 156 insertions(+), 161 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1vSqfa-003ZDP-1N@gemulon.postgresql.org>
Permalink:  ../E1vSqfa-003ZDP-1N@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vSqfa-003ZDP-1N@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Use palloc_object() and palloc_array() in more areas of the tree
  In-Reply-To: <E1vSqfa-003ZDP-1N@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox