Skip to content

Commit

Permalink
use valid alignment for the thread local storage
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed Apr 9, 2023
1 parent b0005dd commit ac427ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/demo/src/tests/thread_local.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pub fn test_thread_local() -> Result<(), ()> {
#[repr(align(0x1000))]
struct OverAligned(u8);
#[repr(align(0x10))]
struct Aligned(u8);

thread_local! {
static THREAD_LOCAL: OverAligned = const { OverAligned(0x42) };
static THREAD_LOCAL: Aligned = const { Aligned(0x42) };
}

THREAD_LOCAL.with(|thread_local| {
Expand Down

0 comments on commit ac427ae

Please sign in to comment.