From 26ab71043d97c1b06bdd252378b64171cb95b1a9 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Fri, 19 Aug 2022 21:22:18 -0700 Subject: Updated docs --- src/alloc.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/alloc.rs') 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; -- cgit v1.2.1