Changeset View
Changeset View
Standalone View
Standalone View
compiler-rt/lib/scudo/standalone/tests/primary_test.cpp
Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | #endif | ||||
testIteratePrimary<scudo::SizeClassAllocator64<SizeClassMap, 24U, true>>(); | testIteratePrimary<scudo::SizeClassAllocator64<SizeClassMap, 24U, true>>(); | ||||
} | } | ||||
static std::mutex Mutex; | static std::mutex Mutex; | ||||
static std::condition_variable Cv; | static std::condition_variable Cv; | ||||
static bool Ready; | static bool Ready; | ||||
template <typename Primary> static void performAllocations(Primary *Allocator) { | template <typename Primary> static void performAllocations(Primary *Allocator) { | ||||
static THREADLOCAL typename Primary::CacheT Cache; | static thread_local typename Primary::CacheT Cache; | ||||
Cache.init(nullptr, Allocator); | Cache.init(nullptr, Allocator); | ||||
std::vector<std::pair<scudo::uptr, void *>> V; | std::vector<std::pair<scudo::uptr, void *>> V; | ||||
{ | { | ||||
std::unique_lock<std::mutex> Lock(Mutex); | std::unique_lock<std::mutex> Lock(Mutex); | ||||
while (!Ready) | while (!Ready) | ||||
Cv.wait(Lock); | Cv.wait(Lock); | ||||
} | } | ||||
for (scudo::uptr I = 0; I < 256U; I++) { | for (scudo::uptr I = 0; I < 256U; I++) { | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |