3 ms·
Trampolines do this. A good example is that this happens in objective-c all the time when you get a block imp. The closure from the block is wrapped into a new
by zbowling 13y ago
Trampolines do this.
A good example is that this happens in objective-c all the time when you get a block imp. The closure from the block is wrapped into a new trampoline so the you can use the block as any normal imp but with the closures state stored correctly.
You can actually do this really easily and in a cross platform way with libffi.
What is ingesting is if you are a secured platform, you might not be able to mark a page as executable and writable so this isn't always possible. On iOS we had to do an amazing hack with a .S file and the vm_remap call on Darwin. Libffi uses a cute technique as well.