macro fix

This commit is contained in:
Robin Müller 2025-01-31 12:04:40 +01:00
parent 3d12083c16
commit af972e174f
Signed by: muellerr
GPG Key ID: A649FB78196E3849

View File

@ -434,18 +434,18 @@ pub mod heapless_mod {
#[macro_export]
macro_rules! static_subpool {
($pool_name: ident, $sizes_list_name: ident, $num_blocks: expr, $block_size: expr) => {
static $pool_name: satrs::pool::UnsafeCellBufWrapper<[u8; $num_blocks * $block_size]> =
satrs::pool::UnsafeCellBufWrapper::new([0; $num_blocks * $block_size]);
static $sizes_list_name: UnsafeCellBufWrapper<[usize; $num_blocks]> =
satrs::pool::UnsafeCellBufWrapper::new([$crate::pool::STORE_FREE; $num_blocks]);
static $pool_name: $crate::pool::UnsafeCellBufWrapper<[u8; $num_blocks * $block_size]> =
$crate::pool::UnsafeCellBufWrapper::new([0; $num_blocks * $block_size]);
static $sizes_list_name: $crate::pool::UnsafeCellBufWrapper<[usize; $num_blocks]> =
$crate::pool::UnsafeCellBufWrapper::new([$crate::pool::STORE_FREE; $num_blocks]);
};
($pool_name: ident, $sizes_list_name: ident, $num_blocks: expr, $block_size: expr, $meta_data: meta) => {
#[$meta_data]
static $pool_name: satrs::pool::UnsafeCellBufWrapper<[u8; $num_blocks * $block_size]> =
satrs::pool::UnsafeCellBufWrapper::new([0; $num_blocks * $block_size]);
static $pool_name: $crate::pool::UnsafeCellBufWrapper<[u8; $num_blocks * $block_size]> =
$crate::pool::UnsafeCellBufWrapper::new([0; $num_blocks * $block_size]);
#[$meta_data]
static $sizes_list_name: satrs::pool::UnsafeCellBufWrapper<[usize; $num_blocks]> =
satrs::pool::UnsafeCellBufWrapper::new([$crate::pool::STORE_FREE; $num_blocks]);
static $sizes_list_name: $crate::pool::UnsafeCellBufWrapper<[usize; $num_blocks]> =
$crate::pool::UnsafeCellBufWrapper::new([$crate::pool::STORE_FREE; $num_blocks]);
};
}