Skip to content

Commit

Permalink
kernel update quality of life
Browse files Browse the repository at this point in the history
- consolidate `{try_}{pin_}init!`
- add derive macro for `Zeroable`
- make guards in the init macros hygienic
- wrap type checking struct initializers in a closure
- add `..Zeroable::zeroed()` syntax for zeroing all missing fields
- Add functions to create array initializers

also fix test stderrs
  • Loading branch information
y86-dev committed Jun 23, 2023
1 parent 7223d60 commit e120934
Show file tree
Hide file tree
Showing 8 changed files with 502 additions and 375 deletions.
2 changes: 2 additions & 0 deletions examples/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use pinned_init::*;
pub mod linked_list;
use linked_list::*;

#[derive(Debug)]
pub struct SpinLock {
inner: AtomicBool,
}
Expand Down Expand Up @@ -55,6 +56,7 @@ impl Drop for SpinLockGuard<'_> {
}

#[pin_data]
#[derive(Debug)]
pub struct CMutex<T> {
#[pin]
wait_list: ListHead,
Expand Down
Loading

0 comments on commit e120934

Please sign in to comment.