[K/N] Add flag to disable allocator overhead estimate
This commit is contained in:
committed by
Space Cloud
parent
3ae7b790a9
commit
239f3a30cb
@@ -52,6 +52,7 @@ void alloc::Allocator::clearForTests() noexcept {
|
||||
}
|
||||
|
||||
size_t alloc::Allocator::estimateOverheadPerThread() noexcept {
|
||||
if (compiler::disableAllocatorOverheadEstimate()) return 0;
|
||||
return impl_->heap().EstimateOverheadPerThread();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
extern "C" const int32_t Kotlin_needDebugInfo;
|
||||
extern "C" const int32_t Kotlin_runtimeAssertsMode;
|
||||
extern "C" const int32_t Kotlin_disableMmap;
|
||||
extern "C" const int32_t Kotlin_disableAllocatorOverheadEstimate;
|
||||
extern "C" const char* const Kotlin_runtimeLogs;
|
||||
extern "C" const int32_t Kotlin_concurrentWeakSweep;
|
||||
extern "C" const int32_t Kotlin_gcMarkSingleThreaded;
|
||||
@@ -77,6 +78,10 @@ ALWAYS_INLINE inline bool disableMmap() noexcept {
|
||||
return Kotlin_disableMmap != 0;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE inline bool disableAllocatorOverheadEstimate() noexcept {
|
||||
return Kotlin_disableAllocatorOverheadEstimate != 0;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE inline std::string_view runtimeLogs() noexcept {
|
||||
return Kotlin_runtimeLogs == nullptr ? std::string_view() : std::string_view(Kotlin_runtimeLogs);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ extern const int32_t Kotlin_disableMmap = 1;
|
||||
#else
|
||||
extern const int32_t Kotlin_disableMmap = 0;
|
||||
#endif
|
||||
extern const int32_t Kotlin_disableAllocatorOverheadEstimate = 0;
|
||||
extern const char* const Kotlin_runtimeLogs = nullptr;
|
||||
extern const int32_t Kotlin_concurrentWeakSweep = 1;
|
||||
#if KONAN_WINDOWS
|
||||
|
||||
Reference in New Issue
Block a user