mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #6707 - pcwalton:more-fds, r=larsbergstrom
script: Increase our file descriptor limit on Linux. We've had problems with this before, and I think it's starting to cause problems again. See PRs #6629 and #6616; my current theory is that this is the problem. r? @larsbergstrom <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6707) <!-- Reviewable:end -->
This commit is contained in:
commit
0d7744b198
1 changed files with 22 additions and 0 deletions
|
@ -94,9 +94,31 @@ mod devtools;
|
|||
mod horribly_inefficient_timers;
|
||||
mod webdriver_handlers;
|
||||
|
||||
#[cfg(any(target_os="linux", target_os="android"))]
|
||||
#[allow(unsafe_code)]
|
||||
fn perform_platform_specific_initialization() {
|
||||
use std::mem;
|
||||
const RLIMIT_NOFILE: libc::c_int = 7;
|
||||
|
||||
// Bump up our number of file descriptors to save us from impending doom caused by an onslaught
|
||||
// of iframes.
|
||||
unsafe {
|
||||
let mut rlim = mem::uninitialized();
|
||||
assert!(libc::getrlimit(RLIMIT_NOFILE, &mut rlim) == 0);
|
||||
rlim.rlim_cur = rlim.rlim_max;
|
||||
assert!(libc::setrlimit(RLIMIT_NOFILE, &mut rlim) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os="linux", target_os="android")))]
|
||||
fn perform_platform_specific_initialization() {}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn init() {
|
||||
unsafe {
|
||||
assert_eq!(js::jsapi::JS_Init(), 1);
|
||||
}
|
||||
|
||||
perform_platform_specific_initialization();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue