chore: update toolchain version to 2024-11-05 (#1031)

* chore: update toolchain version to 2024-11-05

* update dragon reach to e945c217b3

* update dog to 6f2c0c8f12

---------

Co-authored-by: longjin <longjin@DragonOS.org>
This commit is contained in:
linfeng
2024-11-11 21:29:15 +08:00
committed by GitHub
parent 69715438f2
commit 7c28051e8c
99 changed files with 242 additions and 379 deletions

View File

@ -13,7 +13,7 @@ pub struct AllocBitmap {
impl AllocBitmap {
pub fn new(elements: usize) -> Self {
let data = vec![0usize; (elements + usize::BITS as usize - 1) / (usize::BITS as usize)];
let data = vec![0usize; elements.div_ceil(usize::BITS as usize)];
Self {
elements,
data,

View File

@ -8,15 +8,15 @@ use crate::{bitmap_core::BitMapCore, traits::BitMapOps};
#[derive(Debug, Clone)]
pub struct StaticBitmap<const N: usize>
where
[(); (N + usize::BITS as usize - 1) / (usize::BITS as usize)]:,
[(); N.div_ceil(usize::BITS as usize)]:,
{
pub data: [usize; (N + usize::BITS as usize - 1) / (usize::BITS as usize)],
pub data: [usize; N.div_ceil(usize::BITS as usize)],
core: BitMapCore<usize>,
}
impl<const N: usize> Default for StaticBitmap<N>
where
[(); (N + usize::BITS as usize - 1) / (usize::BITS as usize)]:,
[(); N.div_ceil(usize::BITS as usize)]:,
{
fn default() -> Self {
Self::new()
@ -25,12 +25,12 @@ where
impl<const N: usize> StaticBitmap<N>
where
[(); (N + usize::BITS as usize - 1) / (usize::BITS as usize)]:,
[(); N.div_ceil(usize::BITS as usize)]:,
{
/// 创建一个新的静态位图
pub const fn new() -> Self {
Self {
data: [0; (N + usize::BITS as usize - 1) / (usize::BITS as usize)],
data: [0; N.div_ceil(usize::BITS as usize)],
core: BitMapCore::new(),
}
}
@ -38,7 +38,7 @@ where
impl<const N: usize> BitMapOps<usize> for StaticBitmap<N>
where
[(); (N + usize::BITS as usize - 1) / (usize::BITS as usize)]:,
[(); N.div_ceil(usize::BITS as usize)]:,
{
#[inline]
fn get(&self, index: usize) -> Option<bool> {