mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove uses of mem::uninitialized
This commit is contained in:
parent
0677704953
commit
b6bd2d7302
4 changed files with 68 additions and 65 deletions
|
@ -106,14 +106,16 @@ use script_traits::SWManagerSenders;
|
|||
#[cfg(target_os = "linux")]
|
||||
#[allow(unsafe_code)]
|
||||
fn perform_platform_specific_initialization() {
|
||||
use std::mem;
|
||||
// 4096 is default max on many linux systems
|
||||
const MAX_FILE_LIMIT: libc::rlim_t = 4096;
|
||||
|
||||
// Bump up our number of file descriptors to save us from impending doom caused by an onslaught
|
||||
// of iframes.
|
||||
unsafe {
|
||||
let mut rlim: libc::rlimit = mem::uninitialized();
|
||||
let mut rlim = libc::rlimit {
|
||||
rlim_cur: 0,
|
||||
rlim_max: 0,
|
||||
};
|
||||
match libc::getrlimit(libc::RLIMIT_NOFILE, &mut rlim) {
|
||||
0 => {
|
||||
if rlim.rlim_cur >= MAX_FILE_LIMIT {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue