aboutsummaryrefslogtreecommitdiff
path: root/src/alloc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.rs')
-rw-r--r--src/alloc.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/alloc.rs b/src/alloc.rs
index 9b77f13..0c0df56 100644
--- a/src/alloc.rs
+++ b/src/alloc.rs
@@ -6,10 +6,14 @@
/// - Default: Default value
/// - Type: Data Type
macro_rules! init_queue {
- ($name:tt,$size:tt,$default:tt,$type:ty) => {
- #[link_section = ".data.alloc"]
- pub static $name: QueueAllocator<'static, $type, {$size+2}> = QueueAllocator::<$type, {$size+2}>{inner: NullLock::new([QueueItem{data: $default, next: None}; {$size+2}])};
- }
+ ($name:tt,$size:tt,$default:tt,$type:ty) => {
+ init_queue!{@gen [$name,$size,$default,$type,concat!("# ", stringify!($type), " Queue Allocator")]}
+ };
+ (@gen [$name:tt,$size:tt,$default:tt,$type:ty,$doc:expr]) => {
+ #[doc = $doc]
+ #[link_section = ".data.alloc"]
+ pub static $name: QueueAllocator<'static, $type, {$size+2}> = QueueAllocator::<$type, {$size+2}>{inner: NullLock::new([QueueItem{data: $default, next: None}; {$size+2}])};
+ };
}
use crate::sync::NullLock;