The core::intrinsics::unreachable() we used at the end of every naked
function is essentially pointless, as #[naked] implies that intrinsic
at the end of the function. rustc currently does not implement that
behavior (rust-lang/rust#32487), but it is a bug. On top of that,
anything except a single asm!() in naked functions is likely to be
disallowed in the future (rust-lang/rust#32490).
A nice side effect is that we avoid the core_intrinsics feature,
which will be never stabilized, though neither asm nor
naked_functions are likely to be stabilized soon.
Also, remove the Windows OsStack implementation. It will not ever
be useful in libfringe, as even if we add support for Windows
using fibers, the OS allocates stacks for fibers and we needn't
do it manually.
The new design concerns itself with one thing and exactly one thing:
passing values back and forth with an extern "C" function.
This allows to simplify fringe::arch into a single primitive, swap.
Close#21
fix#3
This takes all Valgrind functionality private again.
Valgrind stack registrations are now associated with a Context, not with
a Stack. This makes sense, since it's only actually a stack when a
Context is running on it. Perhaps Valgrind will even be able to detect
early stack frees now.
We're now handling more of this ourselves, and leaving less to libstd.
Hopefully, we'll eventually break free of libstd, leaving a
highly-focused low-level library that retains all its conveniences in
freestanding environments.
featuring 7ns inlineable context switches, no more separately-built
assembly objects, and a vastly nicer interface.
incontext/outcontext are no more, context switch calls now take a single
context structure, which functions as both.
everything now also functions without any heap allocations -- for the
context setup, only an FnOnce() value is necessary.