~/lightning

Implementing coroutines using C++17

Lightningat Meeting C++ 2023 · 2023-11-12..11-14· [rust]
name:Alon Wolf
links:none on file
slides:none on file

An actual C++17 coroutine implementation appears, about 200 lines of code with accompanying test cases, and it literally smashes the return address on MSVC x64 using a tiny assembly shim to implement resume. Pause and resume work by storing and restoring the return address via a noinline helper and builtin return address, with an extra asm clobber to force reload of registers. Frame storage uses recursive struct inheritance to compute sizes, macros to declare frames, and explicit cleanup functions for proper destruction — and it runs.

AI-written summary · about

~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.