Skip to content

Commit 8476c28

Browse files
yfeldblummeta-codesync[bot]
authored andcommitted
migrate rename to folly::available_concurrency (assorted)
Summary: X-link: facebookresearch/DCPerf#461 X-link: facebookincubator/nimble#484 The name `hardware_concurrency`, while parallel to `std::thread::hardware_concurrency`, may be misleading. Migrate to the name `available_concurrency`. Reviewed By: Magoja Differential Revision: D93262843 fbshipit-source-id: 5c8400fe8b4c8a4d7a4fb5f994a712ffdcae01e4
1 parent 02e627b commit 8476c28

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

hphp/util/concurrent-lru-cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ template <class TKey, class TValue, class THash>
241241
ConcurrentLRUCache<TKey, TValue, THash>::
242242
ConcurrentLRUCache(size_t maxSize)
243243
: m_maxSize(maxSize), m_size(0),
244-
m_map(folly::hardware_concurrency() * 4) // it will automatically grow
244+
m_map(folly::available_concurrency() * 4) // it will automatically grow
245245
{
246246
m_head.m_prev = nullptr;
247247
m_head.m_next = &m_tail;

hphp/util/concurrent-scalable-cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ConcurrentScalableCache(size_t maxSize, size_t numShards)
125125
: m_maxSize(maxSize), m_numShards(numShards)
126126
{
127127
if (m_numShards == 0) {
128-
m_numShards = folly::hardware_concurrency();
128+
m_numShards = folly::available_concurrency();
129129
}
130130
for (size_t i = 0; i < m_numShards; i++) {
131131
size_t s = maxSize / m_numShards;

0 commit comments

Comments
 (0)