Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use cfg attributes over macro #5999

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions crates/storage/db/src/implementation/mdbx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,17 @@ const DEFAULT_MAX_READERS: u64 = 32_000;
/// See [reth_libmdbx::EnvironmentBuilder::set_handle_slow_readers] for more information.
const MAX_SAFE_READER_SPACE: usize = 10 * GIGABYTE;

static PROCESS_ID: Lazy<u32> =
Lazy::new(|| if cfg!(unix) { std::os::unix::process::parent_id() } else { std::process::id() });
static PROCESS_ID: Lazy<u32> = Lazy::new(|| {
#[cfg(unix)]
{
std::os::unix::process::parent_id()
}

#[cfg(not(unix))]
{
std::process::id()
}
});

/// Environment used when opening a MDBX environment. RO/RW.
#[derive(Debug)]
Expand Down
Loading