Re:Why Rust closures are somewhat hard
by mikeash on Monday September 10, 2018 @03:35PM
(#17954466)
Should be able to do it without refcounting if you wanted to go even more minimal, too. Make a call to copy the storage, and another one to destroy it. Then the user can use whatever lifetime management they already use for other things.
The runtime’s public API is very small: https://github.com/mackyle/blocksruntime/blob/master/BlocksR...
Behind the scenes it implements reference counting though.