RE: Use allocation macros in the logical replication code

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Peter Smith' <smithpb2250@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-02-04T02:47:16Z
Lists: pgsql-hackers
Dear Peter,

Thanks for the patch. I have one comment for the patch:
```
@@ -836,8 +836,9 @@ SnapBuildAddCommittedTxn(SnapBuild *builder, TransactionId xid)
 		elog(DEBUG1, "increasing space for committed transactions to %u",
 			 (uint32) builder->committed.xcnt_space);
 
-		builder->committed.xip = repalloc(builder->committed.xip,
-										  builder->committed.xcnt_space * sizeof(TransactionId));
+		builder->committed.xip = repalloc_array(builder->committed.xip,
+							TransactionId,
+							builder->committed.xcnt_space);
```

Number of tabs seems not to enough here. Other than that LGTM.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Commits

  1. Use palloc_object() and palloc_array() in more areas of the logical replication.