Bug 1036682 - Account for OPEN_MAX when calling setrlimit on OS X r=snorp
authorGeorge Wright <george@mozilla.com>
Fri, 06 Feb 2015 14:29:26 -0500
changeset 245430 2e998e2012dd08c063de13639eb781a554b214f5
parent 245429 76eed30e8d1db20af31a9871593c2b91028d3ee4
child 245431 b84dc805c33275cf51138d194ce8cd9cbb7caff7
push id7677
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 18:11:24 +0000
treeherdermozilla-aurora@f531d838c055 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1036682
milestone38.0a1
Bug 1036682 - Account for OPEN_MAX when calling setrlimit on OS X r=snorp
gfx/thebes/gfxPlatformMac.cpp
--- a/gfx/thebes/gfxPlatformMac.cpp
+++ b/gfx/thebes/gfxPlatformMac.cpp
@@ -80,20 +80,20 @@ gfxPlatformMac::gfxPlatformMac()
                           BackendTypeBit(BackendType::COREGRAPHICS);
     uint32_t contentMask = BackendTypeBit(BackendType::COREGRAPHICS);
     InitBackendPrefs(canvasMask, BackendType::COREGRAPHICS,
                      contentMask, BackendType::COREGRAPHICS);
 
     // XXX: Bug 1036682 - we run out of fds on Mac when using tiled layers because
     // with 256x256 tiles we can easily hit the soft limit of 800 when using double
     // buffered tiles in e10s, so let's bump the soft limit to the hard limit for the OS
-    // up to a new cap of 16k
+    // up to a new cap of OPEN_MAX.
     struct rlimit limits;
     if (getrlimit(RLIMIT_NOFILE, &limits) == 0) {
-        limits.rlim_cur = std::min(rlim_t(16384), limits.rlim_max);
+        limits.rlim_cur = std::min(rlim_t(OPEN_MAX), limits.rlim_max);
         if (setrlimit(RLIMIT_NOFILE, &limits) != 0) {
             NS_WARNING("Unable to bump RLIMIT_NOFILE to the maximum number on this OS");
         }
     }
 }
 
 gfxPlatformMac::~gfxPlatformMac()
 {