good_memory_allocator::Allocator unusable in a static variable
#![no_std] #![no_main] #![feature(allocator_api)] pub static SPINALLOCATOR: Allocator = Allocator::empty();
This single line of code throw multiple instances of the following error: "shared static variables must have a type that implements Sync", it works perfectly if is use it as a global allocator.
Am i doing something wrong?
Detailed Errors:
*mut Option<NonNull<good_memory_allocator::chunks::FreeChunk>> cannot be shared between threads safely
within good_memory_allocator::Allocator<20, 8>, the trait Sync is not implemented for *mut Option<NonNull<good_memory_allocator::chunks::FreeChunk>>
shared static variables must have a type that implements Syncrustc
chunks.rs(750, 12): required because it appears within the type FakeFreeChunk
lib.rs(113, 12): required because it appears within the type Allocator<20, 8>
NonNull<good_memory_allocator::chunks::FreeChunk> cannot be shared between threads safely
within good_memory_allocator::Allocator<20, 8>, the trait Sync is not implemented for NonNull<good_memory_allocator::chunks::FreeChunk>
shared static variables must have a type that implements Syncrustc
option.rs(563, 10): required because it appears within the type Option<NonNull<FreeChunk>>
chunks.rs(750, 12): required because it appears within the type FakeFreeChunk
lib.rs(113, 12): required because it appears within the type Allocator<20, 8>