Trait redox_buffer_pool::Handle [−][src]
pub trait Handle<I, E> where
E: Copy,
Self: Sized, { type Error; fn close(
&mut self,
mmap_entries: MmapEntries<I, E>
) -> Result<(), Self::Error>; fn close_all(
self,
mmap_entries: MmapEntries<I, E>
) -> Result<(), Self::Error> { ... } }
Expand description
The requirement of a handle to be able to be passed into the buffer pool.
This trait is only currently used in the destructor of the buffer pool, after all the ranges have been validated not to be in use by an active guard.
Associated Types
The possible error that may occur when freeing one or more mmap entries. This error type is
forwarded to the buffer pool when this handle is used, which only currently happens in the
destructor of BufferPool
.
Required methods
The function called when a buffer pool wants one or more ranges, proven not to contain guarded slices, to be deallocated.
This function is only called directly when a full close failed due to active guards, or in
the default implementation of close_all
.
Provided methods
The function called when a buffer pool is dropped.
All the mmap ranges (originating from begin_expand
) that have been initialized, are
also included here. The reason this function exists, is to allow for more performant memory
deallocation, when it is known that the buffer pool did not contain any guarded buffer slice.
An implementor might for example, close the file descriptor rather than repeatedly calling munmap(2), if mmap(2) is used internally.