feat: add function to get fd of memfd
This commit is contained in:
@@ -91,6 +91,10 @@ impl BumpAllocator {
|
|||||||
|
|
||||||
offset as usize
|
offset as usize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn get_fd(&self) -> i32 {
|
||||||
|
self.backing_fd
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
#![feature(test)]
|
#![feature(test)]
|
||||||
#![feature(lazy_cell)]
|
#![feature(lazy_cell)]
|
||||||
|
|
||||||
|
use bump_allocator::BUMP_ALLOCATOR;
|
||||||
|
|
||||||
mod allocator;
|
mod allocator;
|
||||||
mod bump_allocator;
|
mod bump_allocator;
|
||||||
pub mod sharedptr;
|
pub mod sharedptr;
|
||||||
|
|
||||||
|
pub fn get_shared_mem_fd() -> i32 {
|
||||||
|
let allocator = BUMP_ALLOCATOR.lock().unwrap();
|
||||||
|
|
||||||
|
allocator.get_fd()
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user