mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
#5244 Pass `JEMALLOC_SYS_WITH_LG_PAGE=16` env to aarch64 cross-compilation to support systems with up to 64-KiB page sizes. This is backwards-compatible for the current (most usual) 4-KiB systems.
This commit is contained in:
committed by
GitHub
parent
66c6552e8c
commit
d297d08c6b
@@ -9,7 +9,7 @@
|
||||
//! B) `_RJEM_MALLOC_CONF` at runtime.
|
||||
use metrics::{set_gauge, try_create_int_gauge, IntGauge};
|
||||
use std::sync::LazyLock;
|
||||
use tikv_jemalloc_ctl::{arenas, epoch, stats, Error};
|
||||
use tikv_jemalloc_ctl::{arenas, epoch, stats, Access, AsName, Error};
|
||||
|
||||
#[global_allocator]
|
||||
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
|
||||
@@ -52,3 +52,18 @@ pub fn scrape_jemalloc_metrics_fallible() -> Result<(), Error> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn page_size() -> Result<usize, Error> {
|
||||
// Full list of keys: https://jemalloc.net/jemalloc.3.html
|
||||
"arenas.page\0".name().read()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn page_size_ok() {
|
||||
assert!(page_size().is_ok());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
not(target_env = "musl"),
|
||||
not(feature = "jemalloc")
|
||||
))]
|
||||
mod glibc;
|
||||
pub mod glibc;
|
||||
|
||||
#[cfg(feature = "jemalloc")]
|
||||
mod jemalloc;
|
||||
pub mod jemalloc;
|
||||
|
||||
pub use interface::*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user