On Fri, Mar 27, 2026 at 08:03:30AM +0900, Michael Paquier wrote:
> Still, I slightly prefer your v2, where the interface of vacuum_rel()
> is leaner with all the other ones. It comes at the cost of copying
> the input parameters into a temporary "copy" of VacuumParams, but I
> see the fact of marking the input "params" with a const as more
> valuable in the long-run, with less temptation to manipulate it
> directly especially it is not not marked with a const. One small
> worry with v3 is that people like copy-pasting code around, and I
> suspect that v2 could discourage better the patterns that 2252fcd4276c
> has tried to improve and that 661643dedad9 had to fix.
I disagree with you here. By passing the struct by-value, we are avoiding
scribbles on the original one without an explicit memcpy and without a big
comment warning folks to only use the copy (which seems like it'd be easy
to miss). I think using a const pointer in most places makes sense, but
not if we need to immediately copy the contents to a local variable anyway.
--
nathan