()
| 133 | /// Create a new jemalloc arena. Returns the new arena's index. |
| 134 | #[cfg(not(target_arch = "wasm32"))] |
| 135 | fn create_arena() -> Result<u32> { |
| 136 | // SAFETY: `arenas.create` is a standard jemalloc mallctl that creates a new |
| 137 | // arena and returns its unsigned index. No pointers are involved. |
| 138 | let arena_idx: u32 = unsafe { tikv_jemalloc_ctl::raw::read(b"arenas.create\0") } |
| 139 | .map_err(|e| MemError::Jemalloc(format!("failed to create arena: {e:?}")))?; |
| 140 | Ok(arena_idx) |
| 141 | } |
| 142 | |
| 143 | /// Pin the calling thread to a specific arena. |
| 144 | #[cfg(not(target_arch = "wasm32"))] |
no test coverage detected