Repository navigation
GH-48339: [C++] Enhance functions in util/ubsan.h to support types without a default constructor - #48429
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. |
|
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. |
…pes without a default constructor (apache#48429) ### Rationale for this change `arrow::util::SafeLoadAs`, `arrow::util::SafeLoad`, and `arrow::util::SafeCopy` do 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. * GitHub Issue: apache#48339 Authored-by: arash andishgar <arashandishgar1@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
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.