#include <folly/detail/ThreadLocalDetail.h>
#include <algorithm>
#include <list>
#include <mutex>
#include <folly/detail/thread_local_globals.h>
#include <folly/lang/Hint.h>
#include <folly/memory/SanitizeLeak.h>
#include <folly/synchronization/CallOnce.h>
constexpr auto kSmallGrowthFactor = …;
constexpr auto kBigGrowthFactor = …;
namespace folly {
namespace threadlocal_detail {
SharedPtrDeleter::SharedPtrDeleter(std::shared_ptr<void> const& ts) noexcept
: … { … }
SharedPtrDeleter::SharedPtrDeleter(SharedPtrDeleter const& that) noexcept
: … { … }
SharedPtrDeleter::~SharedPtrDeleter() = default;
void SharedPtrDeleter::operator()(
void* , folly::TLPDestructionMode) const { … }
uintptr_t ElementWrapper::castForgetAlign(DeleterFunType* f) noexcept { … }
bool ThreadEntrySet::basicSanity() const { … }
void ThreadEntrySet::compress() { … }
StaticMetaBase::StaticMetaBase(ThreadEntry* (*threadEntry)(), bool strict)
: … { … }
ThreadEntryList* StaticMetaBase::getThreadEntryList() { … }
bool StaticMetaBase::dying() { … }
void StaticMetaBase::onThreadExit(void* ptr) { … }
void StaticMetaBase::cleanupThreadEntriesAndList(
ThreadEntryList* threadEntryList) { … }
uint32_t StaticMetaBase::elementsCapacity() const { … }
uint32_t StaticMetaBase::allocate(EntryID* ent) { … }
void StaticMetaBase::destroy(EntryID* ent) { … }
ElementWrapper* StaticMetaBase::reallocate(
ThreadEntry* threadEntry, uint32_t idval, size_t& newCapacity) { … }
void StaticMetaBase::reserve(EntryID* id) { … }
void* ThreadEntry::releaseElement(uint32_t id) { … }
void ThreadEntry::cleanupElement(uint32_t id) { … }
FOLLY_STATIC_CTOR_PRIORITY_MAX
PthreadKeyUnregister PthreadKeyUnregister::instance_;
#if defined(__GLIBC__)
struct GlibcThreadLocalInit {
struct GlibcThreadLocalInitHelper {
FOLLY_NOINLINE ~GlibcThreadLocalInitHelper() {
compiler_must_not_elide(this);
}
};
GlibcThreadLocalInit() {
static thread_local GlibcThreadLocalInitHelper glibcThreadLocalInit;
compiler_must_not_elide(glibcThreadLocalInit);
}
};
__attribute__((
__init_priority__(101))) GlibcThreadLocalInit glibcThreadLocalInit;
#endif
}
}