Disable "limit virtual memory" routine on macOS

This has no effect on macOS.
https://stackoverflow.com/questions/3274385/how-to-limit-memory-of-a-os-x-program-ulimit-v-neither-m-are-working

Closes #18656.
PR  #19805.
This commit is contained in:
Chocobo1 2023-10-29 17:41:38 +08:00 committed by GitHub
parent 98576dacae
commit 7bd8f262db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 8 deletions

View file

@ -373,7 +373,7 @@ void Application::setMemoryWorkingSetLimit(const int size)
return;
m_storeMemoryWorkingSetLimit = size;
#ifdef QBT_USES_LIBTORRENT2
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
applyMemoryWorkingSetLimit();
#endif
}
@ -782,7 +782,7 @@ int Application::exec()
printf("%s\n", qUtf8Printable(loadingStr));
#endif
#ifdef QBT_USES_LIBTORRENT2
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
applyMemoryWorkingSetLimit();
#endif
@ -1134,7 +1134,7 @@ void Application::shutdownCleanup([[maybe_unused]] QSessionManager &manager)
}
#endif
#ifdef QBT_USES_LIBTORRENT2
#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
void Application::applyMemoryWorkingSetLimit() const
{
const size_t MiB = 1024 * 1024;