pg_dump: Use pg_malloc_object() and pg_malloc_array()

Michael Paquier <michael@paquier.xyz>

Commit: 6736dea14afbe239588dad1c947ceb6e50adbf72
Author: Michael Paquier <michael@paquier.xyz>
Date: 2026-02-13T10:48:35Z
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

Discussion