Use pg_malloc_object() and pg_alloc_array() variants in frontend code

This commit updates the frontend tools (src/bin/, contrib/ and
src/test/) to use the memory allocation variants based on
pg_malloc_object() and pg_malloc_array() in various code paths.  This
does not cover all the allocations, but a good chunk of them.

Like all the changes of this kind (31d3847a37be, etc.), this should
encourage any future code to use this new style.

Author: Andreas Karlsson <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/574bee89c237d79e4dd3209f0fa3b10e0179b57a

Modified Files
--------------
contrib/oid2name/oid2name.c                      | 16 ++++----
src/bin/initdb/initdb.c                          |  6 +--
src/bin/pg_amcheck/pg_amcheck.c                  |  8 ++--
src/bin/pg_basebackup/pg_basebackup.c            |  4 +-
src/bin/pg_basebackup/pg_recvlogical.c           |  2 +-
src/bin/pg_basebackup/streamutil.c               |  8 ++--
src/bin/pg_basebackup/walmethods.c               | 14 +++----
src/bin/pg_combinebackup/load_manifest.c         |  4 +-
src/bin/pg_combinebackup/pg_combinebackup.c      |  6 +--
src/bin/pg_combinebackup/reconstruct.c           | 10 ++---
src/bin/pg_combinebackup/write_manifest.c        |  2 +-
src/bin/pg_ctl/pg_ctl.c                          |  4 +-
src/bin/pg_rewind/datapagemap.c                  |  2 +-
src/bin/pg_rewind/libpq_source.c                 |  2 +-
src/bin/pg_rewind/local_source.c                 |  2 +-
src/bin/pg_rewind/pg_rewind.c                    |  2 +-
src/bin/pg_rewind/timeline.c                     |  6 +--
src/bin/pg_upgrade/check.c                       |  4 +-
src/bin/pg_upgrade/function.c                    |  4 +-
src/bin/pg_upgrade/info.c                        | 11 +++---
src/bin/pg_upgrade/parallel.c                    | 12 +++---
src/bin/pg_upgrade/slru_io.c                     |  2 +-
src/bin/pg_upgrade/tablespace.c                  |  4 +-
src/bin/pg_upgrade/task.c                        |  8 ++--
src/bin/pg_verifybackup/astreamer_verify.c       |  2 +-
src/bin/pg_verifybackup/pg_verifybackup.c        |  6 +--
src/bin/pgbench/exprparse.y                      | 16 ++++----
src/bin/pgbench/pgbench.c                        | 22 +++++------
src/bin/psql/command.c                           |  6 +--
src/bin/psql/copy.c                              |  2 +-
src/bin/psql/crosstabview.c                      | 15 +++----
src/bin/psql/describe.c                          |  4 +-
src/bin/psql/tab-complete.in.c                   |  7 ++--
src/bin/psql/variables.c                         |  6 +--
src/bin/scripts/reindexdb.c                      |  6 +--
src/test/isolation/isolationtester.c             | 12 +++---
src/test/isolation/specparse.y                   | 50 ++++++++++++------------
src/test/modules/libpq_pipeline/libpq_pipeline.c |  8 ++--
src/test/regress/pg_regress.c                    |  6 +--
39 files changed, 153 insertions(+), 158 deletions(-)

Reply via email to