Special VDFs to use CustomArg/Result#515
Conversation
Refs #504 Next step - update external repos. Then remove old signatures/update comments.
malone-at-work
left a comment
There was a problem hiding this comment.
Should we be passing by reference for any of these, mutable or otherwise.
| using TypeCompareWithParamsFunc = int (*)(const P &, | ||
| Span<const unsigned char> a, | ||
| Span<const unsigned char> b); | ||
| using TypeCompareWithParamsFunc = int (*)(CustomArgWith<P> a, |
There was a problem hiding this comment.
Should we be passing these by const reference? or value?
There was a problem hiding this comment.
Claude's analysis:
CustomArg and CustomArgWith
are single-pointer handles — class CustomArg { const vef_invalue_t *v_; } (8 bytes on 64-bit). Pass-by-value is the
right call:
Sized like a pointer, copied like a pointer. They're trivially copyable handle types, not aggregates. By-value lands the pointer in a register;
const& forces the wrapper to live in memory so its address can be taken (which the optimizer usually undoes, but at zero benefit). Same reasoning
std::string_view (16 B) and std::span (16 B) are by-value.
Refs #504
Next step - update external repos.
Then remove old signatures/update comments.