diff options
author | Christian Cunningham <cc@localhost> | 2022-08-19 21:22:18 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-08-19 21:22:18 -0700 |
commit | 26ab71043d97c1b06bdd252378b64171cb95b1a9 (patch) | |
tree | 9bea25574fc20e77a4faae6811add97e0a248175 /src/alloc.rs | |
parent | 0d061dac9e31831e4fe426a0df777463043868d7 (diff) |
Updated docs
Diffstat (limited to 'src/alloc.rs')
-rw-r--r-- | src/alloc.rs | 12 |
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; |