Lines Matching defs:BitmapVec

130 /// use kernel::bitmap::BitmapVec;
132 /// let mut b = BitmapVec::new(16, GFP_KERNEL)?;
154 pub struct BitmapVec {
161 impl core::ops::Deref for BitmapVec {
165 let ptr = if self.nbits <= BitmapVec::MAX_INLINE_LEN {
182 impl core::ops::DerefMut for BitmapVec {
184 let ptr = if self.nbits <= BitmapVec::MAX_INLINE_LEN {
195 // SAFETY: We got the right pointer and invariants of [`BitmapVec`] hold.
204 unsafe impl Send for BitmapVec {}
206 /// Enable unsynchronized concurrent access to [`BitmapVec`] through shared references.
210 unsafe impl Sync for BitmapVec {}
212 impl Drop for BitmapVec {
214 if self.nbits <= BitmapVec::MAX_INLINE_LEN {
226 impl BitmapVec {
227 /// The maximum possible length of a `BitmapVec`.
233 /// Construct a longest possible inline [`BitmapVec`].
237 BitmapVec {
239 nbits: BitmapVec::MAX_INLINE_LEN,
243 /// Constructs a new [`BitmapVec`].
245 /// Fails with [`AllocError`] when the [`BitmapVec`] could not be allocated. This
249 if nbits <= BitmapVec::MAX_INLINE_LEN {
250 return Ok(BitmapVec {
263 Ok(BitmapVec {
401 /// use kernel::bitmap::BitmapVec;
403 /// let mut long_bitmap = BitmapVec::new(256, GFP_KERNEL)?;
407 /// let mut short_bitmap = BitmapVec::new(16, GFP_KERNEL)?;
435 /// use kernel::bitmap::BitmapVec;
437 /// let bitmap = BitmapVec::new(64, GFP_KERNEL)?;
529 let b = BitmapVec::new(0, GFP_KERNEL)?;
532 let b = BitmapVec::new(3, GFP_KERNEL)?;
535 let b = BitmapVec::new(1024, GFP_KERNEL)?;
539 let res = BitmapVec::new(1 << 31, GFP_KERNEL);
546 let mut b = BitmapVec::new(128, GFP_KERNEL)?;
580 let mut b = BitmapVec::new(128, GFP_KERNEL)?;
597 // let mut b = BitmapVec::new(128, GFP_KERNEL)?;
604 let mut long_bitmap = BitmapVec::new(256, GFP_KERNEL)?;
609 let mut short_bitmap = BitmapVec::new(32, GFP_KERNEL)?;