Support sanitizers in runtime tests (#4622)
This commit is contained in:
committed by
Nikolay Krasko
parent
3ee8d98726
commit
6cc60ad6a2
@@ -112,7 +112,9 @@ TEST_F(KonanAllocatorAwareTest, PlacementAllocated) {
|
||||
|
||||
TEST_F(KonanAllocatorAwareTest, PlacementConstructedArray) {
|
||||
constexpr size_t kCount = 5;
|
||||
std::array<uint8_t, sizeof(A) * kCount> buffer;
|
||||
// TODO: Consider removing support for placement new[] altogether, since there's no
|
||||
// portable way to know needed storage size ahead of time.
|
||||
alignas(A) std::array<uint8_t, sizeof(A) * kCount + sizeof(size_t)> buffer;
|
||||
A* as = new (buffer.data()) A[kCount];
|
||||
|
||||
std::vector<int> actual;
|
||||
|
||||
@@ -8,6 +8,9 @@ namespace kotlin {
|
||||
#if KONAN_WINDOWS
|
||||
// TODO: Figure out why creating many threads on windows is so slow.
|
||||
constexpr int kDefaultThreadCount = 10;
|
||||
#elif __has_feature(thread_sanitizer)
|
||||
// TSAN has a huge overhead.
|
||||
constexpr int kDefaultThreadCount = 10;
|
||||
#else
|
||||
constexpr int kDefaultThreadCount = 100;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user