MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / create_arena

Function create_arena

nodedb-mem/src/arena.rs:135–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

133/// Create a new jemalloc arena. Returns the new arena's index.
134#[cfg(not(target_arch = "wasm32"))]
135fn 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"))]

Callers 1

pin_thread_arenaFunction · 0.70

Calls 1

readFunction · 0.50

Tested by

no test coverage detected