meowalloc 0.1.3

Toy allocator written in pure rust, with concurrency in mind
#![no_std]
#![feature(allocator_api)]
#![feature(min_generic_const_args)]
#![feature(ptr_alignment_type)]
#![feature(nonzero_ops)]
#![feature(ptr_cast_slice)]
#![expect(incomplete_features)]

mod constants;
mod sys;
mod block;
mod utils;
mod block_store;
mod atomic_bitset;
mod atomic_table;
mod spinlock;
mod superblock;
mod allocator;

pub use crate::{atomic_bitset::WORD_BITS};
pub use crate::allocator::MeowAllocator;

use crate as meowalloc;

#[macro_export]
macro_rules! meow_allocator {
    ($max_superblocks:expr, $max_blocks_per_super:expr) => {
       meowalloc::MeowAllocator<
           $max_superblocks, const { $max_superblocks.div_ceil(meowalloc::WORD_BITS) },
           $max_blocks_per_super, const { $max_blocks_per_super.div_ceil(meowalloc::WORD_BITS) }
       > 
    };
}

/// Allocator that allows for a maximum of 65536 allocations,
/// split between 64 superblocks.
/// 
/// Size: 1 067 152 bytes
pub type MeowAllocator64_1024 = meow_allocator!(64usize, 1024usize);