-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-48339: [C++] Enhance functions in util/ubsan.h to support types without a default constructor #48429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
|
@pitrou
And here is the reference implementation for |
|
@pitrou I’d appreciate your review when you have a moment. |
|
@github-actions crossbow submit -g cpp |
|
Revision: dff4b7c Submitted crossbow builds: ursacomputing/crossbow @ actions-65a6da834d |
Is there any type that you have in mind? There are not many types that are trivially constructible but don't have a default constructor, IMHO. |
@pitrou struct A {
explicit A(int a) : a(a) {}
int a;
};What would you suggest here?
|
|
I'm ok with merging PR, I was wondering if you had a specific reason for submitting it. |
|
Mostly for correctness and to avoid relying on an implicit default-constructibility assumption that isn’t required by trivial copyability, even if we don’t currently have such a type in Arrow. |
pitrou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'll merge
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit aeb6486. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 538 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
arrow::util::SafeLoadAs,arrow::util::SafeLoad, andarrow::util::SafeCopydo not work correctly for types that do not have a default constructor.What changes are included in this PR?
Changed the behavior of the above-mentioned functions to support types that do not have a default constructor.
Are these changes tested?
Yes.
Are there any user-facing changes?
No.