Add environment variable NANO_MEMORY_INTENSIVE to explicitly enable/disable the memory_intensive_instrumentation check. (#4640)

running_within_valgrind doesn't always play well with arm and there may be other reasons to enable/disable this option.
This commit is contained in:
clemahieu 2024-05-23 13:54:44 +01:00 committed by GitHub
commit c16f020af4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -253,6 +253,11 @@ bool running_within_valgrind ()
bool memory_intensive_instrumentation ()
{
auto env = nano::env::get<bool> ("NANO_MEMORY_INTENSIVE");
if (env)
{
return env.value ();
}
return is_tsan_build () || nano::running_within_valgrind ();
}