Skip to content
Snippets Groups Projects
Commit 06972c16 authored by Per's avatar Per
Browse files

lock public aligned

parent 63ce883e
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,7 @@ pub struct Dma2Channel6 {
// NOTE(packed) workaround for rust-lang/rust#41315
#[repr(packed)]
pub struct Buffer<T, CHANNEL> {
#[repr(align(32))]
data: UnsafeCell<T>,
flag: Cell<BorrowFlag>,
state: Cell<State>,
......@@ -195,7 +196,9 @@ impl<T, CHANNEL> Buffer<T, CHANNEL> {
}
}
pub(crate) fn lock(&self) -> &T {
// shuould be pub(crate)
///
pub fn lock(&self) -> &T {
assert_eq!(self.state.get(), State::Unlocked);
assert_ne!(self.flag.get(), WRITING);
......
......@@ -23,6 +23,8 @@
#![feature(get_type_id)]
#![feature(never_type)]
#![feature(unsize)]
#![feature(repr_align)]
#![feature(attr_literals)]
#![no_std]
extern crate cast;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment