Skip to content
Snippets Groups Projects
Verified Commit ea246997 authored by jD91mZM2's avatar jD91mZM2
Browse files

Fix undefined behavior

Transmuting from an immutable to a mutable reference is undefined
behavior in Rust, with the exception of UnsafeCell which tells the
optimizer to not draw too many conclusions. Sadly UnsafeCell::get cannot
yet be used in statics (see https://github.com/rust-lang/rust/issues/51718),
so this works around that by making the statics into functions and
making C macros to call those.
parent 3034114c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment