pg_dump: Use pg_malloc_object() and pg_malloc_array()
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_dump/compress_gzip.c | modified | +3 −3 |
| src/bin/pg_dump/compress_io.c | modified | +2 −2 |
| src/bin/pg_dump/compress_lz4.c | modified | +2 −2 |
| src/bin/pg_dump/compress_none.c | modified | +1 −1 |
| src/bin/pg_dump/compress_zstd.c | modified | +1 −1 |
| src/bin/pg_dump/connectdb.c | modified | +4 −4 |
| src/bin/pg_dump/dumputils.c | modified | +4 −4 |
| src/bin/pg_dump/parallel.c | modified | +7 −7 |
| src/bin/pg_dump/pg_backup_archiver.c | modified | +20 −20 |
| src/bin/pg_dump/pg_backup_custom.c | modified | +4 −4 |
| src/bin/pg_dump/pg_backup_directory.c | modified | +4 −4 |
| src/bin/pg_dump/pg_dumpall.c | modified | +1 −1 |
| src/bin/pg_dump/pg_dump.c | modified | +86 −88 |
| src/bin/pg_dump/pg_dump_sort.c | modified | +6 −6 |
Discussion
- use the malloc macros in pg_dump.c 7 messages · 2026-02-02 → 2026-02-15