]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pg_dump: Use pg_malloc_object() and pg_malloc_array()
authorMichael Paquier <michael@paquier.xyz>
Fri, 13 Feb 2026 10:48:35 +0000 (19:48 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 13 Feb 2026 10:48:35 +0000 (19:48 +0900)
commit6736dea14afbe239588dad1c947ceb6e50adbf72
tree5925b7331ee7b33dba12c34db00e9978c2a00274
parent53c6bd0aa3de58baf828e60c6c8934d0a10a8501
pg_dump: Use pg_malloc_object() and pg_malloc_array()

The idea is to encourage more the use of these allocation routines
across the tree, as these offer stronger type safety guarantees than
pg_malloc() & co (type cast in the result, sizeof() embedded).  This set
of changes is dedicated to the pg_dump code.

Similar work has been done as of 31d3847a37be, as one example.

Author: Peter Smith <smithpb2250@gmail.com>
Reviewed-by: Aleksander Alekseev <aleksander@tigerdata.com>
Discussion: https://postgr.es/m/CAHut+PvpGPDLhkHAoxw_g3jdrYxA1m16a8uagbgH3TGWSKtXNQ@mail.gmail.com
14 files changed:
src/bin/pg_dump/compress_gzip.c
src/bin/pg_dump/compress_io.c
src/bin/pg_dump/compress_lz4.c
src/bin/pg_dump/compress_none.c
src/bin/pg_dump/compress_zstd.c
src/bin/pg_dump/connectdb.c
src/bin/pg_dump/dumputils.c
src/bin/pg_dump/parallel.c
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_directory.c
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump_sort.c
src/bin/pg_dump/pg_dumpall.c