Commit d5e90ceb authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

HashTable: Always include <atomic>

Follow-up to commit 470bf888 ("heap: Resolve data race in addition to
HashTable"), which started using std::atomic outside the
DUMP_HASHTABLE_STATS ifdef.

This fixes the build with libstdc++ (it looks like <atomic> was being
implicitly included by libc++):

../../third_party/blink/renderer/platform/wtf/hash_table.h:1796:31: error: implicit instantiation of undefined template 'std::atomic<std::pair<blink::OffererState, blink::OffererState> *>'
  AsAtomic<ValueType*>(table_).store(new_table, std::memory_order_relaxed);
                              ^
../../third_party/blink/renderer/platform/wtf/hash_table.h:1863:22: note: in instantiation of member function 'WTF::HashTable<std::pair<blink::OffererState, blink::OffererState>, std::pair<blink::OffererState, blink::OffererState>, WTF::IdentityExtractor, WTF::PairHash<blink::OffererState, blink::OffererState>, WTF::HashTraits<std::pair<blink::OffererState
, blink::OffererState> >, WTF::HashTraits<std::pair<blink::OffererState, blink::OffererState> >, WTF::PartitionAllocator>::RehashTo' requested here
  Value* new_entry = RehashTo(new_table, new_table_size, entry);
                     ^
../../third_party/blink/renderer/platform/wtf/hash_table.h:1068:5: note: in instantiation of member function 'WTF::HashTable<std::pair<blink::OffererState, blink::OffererState>, std::pair<blink::OffererState, blink::OffererState>, WTF::IdentityExtractor, WTF::PairHash<blink::OffererState, blink::OffererState>, WTF::HashTraits<std::pair<blink::OffererState,
 blink::OffererState> >, WTF::HashTraits<std::pair<blink::OffererState, blink::OffererState> >, WTF::PartitionAllocator>::Rehash' requested here
    Rehash(new_capacity, nullptr);
    ^
../../third_party/blink/renderer/platform/wtf/hash_set.h:180:11: note: in instantiation of member function 'WTF::HashTable<std::pair<blink::OffererState, blink::OffererState>, std::pair<blink::OffererState, blink::OffererState>, WTF::IdentityExtractor, WTF::PairHash<blink::OffererState, blink::OffererState>, WTF::HashTraits<std::pair<blink::OffererState, b
link::OffererState> >, WTF::HashTraits<std::pair<blink::OffererState, blink::OffererState> >, WTF::PartitionAllocator>::ReserveCapacityForSize' requested here
    impl_.ReserveCapacityForSize(SafeCast<wtf_size_t>(elements.size()));
          ^
../../third_party/blink/renderer/modules/peerconnection/call_setup_state_tracker.cc:26:7: note: in instantiation of member function 'WTF::HashSet<std::pair<blink::OffererState, blink::OffererState>, WTF::PairHash<blink::OffererState, blink::OffererState>, WTF::HashTraits<std::pair<blink::OffererState, blink::OffererState> >, WTF::PartitionAllocator>::HashS
et' requested here
    : valid_offerer_transitions_(
      ^
/usr/lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/bits/atomic_base.h:148:12: note: template is declared here
    struct atomic<_Tp*>;
           ^

Bug: 957519
Change-Id: I0694785f6f5191b82773ea5144dfba20b113afb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951024
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721762}
parent 9e4b644f
......@@ -23,6 +23,7 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_HASH_TABLE_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_HASH_TABLE_H_
#include <atomic>
#include <memory>
#include "base/numerics/checked_math.h"
......@@ -42,7 +43,6 @@
#endif
#if DUMP_HASHTABLE_STATS
#include <atomic>
#include "third_party/blink/renderer/platform/wtf/threading.h"
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment