mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-24 07:27:44 +01:00
fix reset of open file limit on OS X, where setrlimit() incompatibility left the user with their default open file limit.
This number was frequently too small for even medium-sized sessions, causing the code to open/close files via an LRU cache, and doing this during capture for audio files caused a massive decrease in the effective throughput of the system.
This commit is contained in:
parent
bf938eb1d6
commit
2a8049e039
1 changed files with 6 additions and 1 deletions
|
|
@ -215,7 +215,12 @@ lotsa_files_please ()
|
|||
|
||||
if (getrlimit (RLIMIT_NOFILE, &rl) == 0) {
|
||||
|
||||
rl.rlim_cur = rl.rlim_max;
|
||||
#ifdef __APPLE__
|
||||
/* See the COMPATIBILITY note on the Apple setrlimit() man page */
|
||||
rl.rlim_cur = min ((rlim_t) OPEN_MAX, rl.rlim_max);
|
||||
#else
|
||||
rl.rlim_cur = rl.rlim_max;
|
||||
#endif
|
||||
|
||||
if (setrlimit (RLIMIT_NOFILE, &rl) != 0) {
|
||||
if (rl.rlim_cur == RLIM_INFINITY) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue