meowalloc 0.2.2

Toy allocator written in pure rust, with concurrency in mind
Documentation
#![no_std]
#![feature(gca_min_const_items)]
#![feature(allocator_ext)]
#![feature(ptr_alignment_type)]
#![feature(nonzero_ops)]
#![feature(ptr_cast_slice)]
#![feature(const_trait_impl)]
#![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, $min_superblock_pages:expr) => {
       meowalloc::MeowAllocator<
           $max_superblocks, { $max_superblocks.div_ceil(meowalloc::WORD_BITS) },
           $max_blocks_per_super, { $max_blocks_per_super.div_ceil(meowalloc::WORD_BITS) },
           $min_superblock_pages
       > 
    };
}

/// Allocator that allows for a maximum of:
/// - 64512-65536 active allocations at a time (size-dependent),
/// - 8MiB of allocated space (for page size 4KiB)
/// split between 64 superblocks.
/// 
/// Allocator metadata size: 1 067 152 bytes
pub type MeowAllocator64_1024_32 = meow_allocator!(64usize, 1024usize, 32);