From 76ca37981aa7f1f801fafa581b3d8bba1baededa Mon Sep 17 00:00:00 2001 From: Jun Qu Date: Fri, 6 Oct 2017 09:54:59 -0700 Subject: [PATCH] Workaround for a gcc crash Summary: I recently got a gcc crash when using `ConcurrentHashMap` Reviewed By: djwatson Differential Revision: D5994587 fbshipit-source-id: 412d48aa6da12c428bb9ab5ed7a317d89c9580b9 --- folly/concurrency/ConcurrentHashMap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/concurrency/ConcurrentHashMap.h b/folly/concurrency/ConcurrentHashMap.h index f261ac98..65816b6d 100644 --- a/folly/concurrency/ConcurrentHashMap.h +++ b/folly/concurrency/ConcurrentHashMap.h @@ -464,9 +464,9 @@ class ConcurrentHashMap { } SegmentT* ensureSegment(uint64_t i) const { - auto seg = segments_[i].load(std::memory_order_acquire); + SegmentT* seg = segments_[i].load(std::memory_order_acquire); if (!seg) { - auto newseg = (SegmentT*)Allocator().allocate(sizeof(SegmentT)); + SegmentT* newseg = (SegmentT*)Allocator().allocate(sizeof(SegmentT)); newseg = new (newseg) SegmentT(size_ >> ShardBits, load_factor_, max_size_ >> ShardBits); if (!segments_[i].compare_exchange_strong(seg, newseg)) { -- 2.34.1