3 ms·
Apple’s block extensions added a closure syntax to C. The runtime’s public API is very small: https://github.com/mackyle/blocksruntime/blob/master/BlocksRuntim
by pavlov 8y ago
Apple’s block extensions added a closure syntax to C.
The runtime’s public API is very small:
https://github.com/mackyle/blocksruntime/blob/master/BlocksRuntime/Block.h https://github.com/mackyle/blocksruntime/blob/master/BlocksR...
Behind the scenes it implements reference counting though.
- mikeash 8y agoShould 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.