Skip to content

Commit

Permalink
fix violation of warning maybe-uninitialized in hazptr_array
Browse files Browse the repository at this point in the history
Reviewed By: ilvokhin

Differential Revision: D68424716

fbshipit-source-id: 6a4fadb4e9895f5781a233d9b67a74f0c2233987
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Jan 22, 2025
1 parent 8793b00 commit 18172a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third-party/folly/src/folly/synchronization/HazptrHolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class hazptr_array {
static_assert(M > 0, "M must be a positive integer.");

aligned_hazptr_holder<Atom> raw_[M];
bool empty_;
bool empty_{true};

friend hazptr_array<M, Atom> make_hazard_pointer_array<M, Atom>();

Expand All @@ -240,7 +240,7 @@ class hazptr_array {

public:
/** Default empty constructor */
FOLLY_ALWAYS_INLINE hazptr_array() noexcept : empty_(true) {
FOLLY_ALWAYS_INLINE hazptr_array() noexcept {
auto h = reinterpret_cast<hazptr_holder<Atom>*>(&raw_);
for (uint8_t i = 0; i < M; ++i) {
new (&h[i]) hazptr_holder<Atom>();
Expand Down

0 comments on commit 18172a5

Please sign in to comment.