Struct corundum::default::BuddyAlloc [−][src]
pub struct BuddyAlloc {}
A memory allocator with buddy allocation mechanism
To define a new buddy allocator type as a memory pool, you may
use pool!()
macro.
Implementations
impl BuddyAlloc
[src]
pub fn open_impl(filename: &str) -> Result<Self>
[src]
Opens a memory pool file and returns an instance of
BuddyAlloc
if success. The pool remains open as long
as the instance lives.
Trait Implementations
impl Drop for BuddyAlloc
[src]
impl MemPool for BuddyAlloc
[src]
fn name() -> &'static str
[src]
unsafe fn format(filename: &str) -> Result<()>
[src]
Formats the image file
fn gen() -> u32
[src]
fn tx_gen() -> u32
[src]
fn size() -> usize
[src]
fn available() -> usize
[src]
fn used() -> usize
[src]
fn rng() -> Range<u64>
[src]
fn start() -> u64
[src]
fn end() -> u64
[src]
unsafe fn pre_alloc(size: usize) -> (*mut u8, u64, usize, usize)
[src]
unsafe fn pre_dealloc(ptr: *mut u8, size: usize) -> usize
[src]
unsafe fn log64(off: u64, val: u64, z: usize)
[src]
unsafe fn drop_on_failure(off: u64, len: usize, z: usize)
[src]
fn zone(off: u64) -> usize
[src]
unsafe fn prepare(z: usize)
[src]
unsafe fn perform(z: usize)
[src]
unsafe fn discard(z: usize)
[src]
fn allocated(off: u64, len: usize) -> bool
[src]
unsafe fn journals_head() -> &'static u64
[src]
unsafe fn drop_journal(journal: &mut Journal)
[src]
unsafe fn journals<T, F: Fn(&mut HashMap<ThreadId, (u64, i32)>) -> T>(f: F) -> T
[src]
unsafe fn recover()
[src]
fn open<'a, U: 'a + PSafe + RootObj<Self>>(
path: &str,
flags: u32
) -> Result<RootCell<'a, U, Self>>
[src]
path: &str,
flags: u32
) -> Result<RootCell<'a, U, Self>>
fn is_open() -> bool
[src]
fn open_no_root(path: &str, flags: u32) -> Result<Self>
[src]
unsafe fn close() -> Result<()>
[src]
fn print_info()
[src]
unsafe fn apply_flags(path: &str, flags: u32) -> Result<()>
[src]
unsafe fn off_unchecked<T: ?Sized>(x: *const T) -> u64
[src]
unsafe fn get_unchecked<'a, T: 'a + ?Sized>(off: u64) -> &'a T
[src]
unsafe fn get_mut_unchecked<'a, T: 'a + ?Sized>(off: u64) -> &'a mut T
[src]
unsafe fn deref_slice_unchecked<'a, T: 'a>(off: u64, len: usize) -> &'a [T]ⓘ
[src]
unsafe fn deref_slice_unchecked_mut<'a, T: 'a>(
off: u64,
len: usize
) -> &'a mut [T]ⓘ
[src]
off: u64,
len: usize
) -> &'a mut [T]ⓘ
unsafe fn deref<'a, T: 'a>(off: u64) -> Result<&'a T>
[src]
unsafe fn deref_mut<'a, T: 'a>(off: u64) -> Result<&'a mut T>
[src]
fn off<T: ?Sized>(x: *const T) -> Result<u64>
[src]
fn valid<T: ?Sized>(p: *const T) -> bool
[src]
fn contains(addr: u64) -> bool
[src]
unsafe fn alloc(size: usize) -> (*mut u8, u64, usize)
[src]
unsafe fn dealloc(ptr: *mut u8, size: usize)
[src]
unsafe fn alloc_zeroed(size: usize) -> *mut u8
[src]
unsafe fn new<'a, T: PSafe + 'a>(x: T, j: &Journal<Self>) -> &'a mut T
[src]
unsafe fn new_slice<'a, T: PSafe + 'a>(
x: &'a [T],
journal: &Journal<Self>
) -> &'a mut [T]ⓘ
[src]
x: &'a [T],
journal: &Journal<Self>
) -> &'a mut [T]ⓘ
unsafe fn atomic_new<'a, T: 'a>(x: T) -> (&'a mut T, u64, usize, usize)
[src]
unsafe fn atomic_new_slice<'a, T: 'a + PSafe>(
x: &'a [T]
) -> (&'a mut [T], u64, usize, usize)
[src]
x: &'a [T]
) -> (&'a mut [T], u64, usize, usize)
unsafe fn new_uninit<'a, T: PSafe + 'a>(j: &Journal<Self>) -> &'a mut T
[src]
unsafe fn new_uninit_for_layout(size: usize, journal: &Journal<Self>) -> *mut u8
[src]
unsafe fn atomic_new_uninit<'a, T: 'a>() -> (&'a mut T, u64, usize, usize)
[src]
unsafe fn alloc_for_value<'a, T: ?Sized>(x: &T) -> &'a mut T
[src]
unsafe fn free<'a, T: PSafe + ?Sized>(x: &mut T)
[src]
unsafe fn free_slice<'a, T: PSafe>(x: &mut [T])
[src]
unsafe fn free_nolog<'a, T: ?Sized>(x: &T)
[src]
unsafe fn commit()
[src]
unsafe fn commit_no_clear()
[src]
unsafe fn clear()
[src]
unsafe fn rollback()
[src]
unsafe fn rollback_no_clear()
[src]
fn transaction<T, F: FnOnce(&'static Journal<Self>) -> T>(body: F) -> Result<T> where
F: TxInSafe + UnwindSafe,
T: TxOutSafe,
[src]
F: TxInSafe + UnwindSafe,
T: TxOutSafe,
Auto Trait Implementations
impl LooseTxInUnsafe for BuddyAlloc
impl PSafe for BuddyAlloc
impl PSend for BuddyAlloc
impl RefUnwindSafe for BuddyAlloc
impl Send for BuddyAlloc
impl Sync for BuddyAlloc
impl TxInSafe for BuddyAlloc
impl TxOutSafe for BuddyAlloc
impl Unpin for BuddyAlloc
impl UnwindSafe for BuddyAlloc
impl VSafe for BuddyAlloc
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,