Skip to content

Commit

Permalink
tweak Function storage init
Browse files Browse the repository at this point in the history
Summary: Alternative to {D6241712}.

Reviewed By: luciang

Differential Revision: D47317649

fbshipit-source-id: 7088eee30ff3fa0dcc8c0884dc0cd2d0c0f5c842
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Jul 9, 2023
1 parent 404aaa7 commit 1bb8d2b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions folly/Function.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ namespace function {
enum class Op { MOVE, NUKE, HEAP };

union Data {
Data() {}
void* big;
std::aligned_storage<6 * sizeof(void*)>::type tiny;
};
Expand Down Expand Up @@ -649,7 +648,7 @@ class Function final : private detail::function::FunctionTraits<FunctionType> {
// invoking undefined behavior. Const-correctness is only violated when
// `FunctionType` is a const function type (e.g., `int() const`) and `*this`
// is the result of calling `constCastFunction`.
mutable Data data_{};
mutable Data data_{unsafe_default_initialized};
Call call_{&Traits::uninitCall};
Exec exec_{nullptr};

Expand Down

0 comments on commit 1bb8d2b

Please sign in to comment.