3 ms·
Neat idea. Presumably a dynamic JIT like HotSpot would use this technique. In C you can have a global function pointer, and mutate it, but presumably that stil
by MaxBarraclough 6y ago
Neat idea. Presumably a dynamic JIT like HotSpot would use this technique.
In C you can have a global function pointer, and mutate it, but presumably that still has an additional indirection compared to the self-modifying approach.
- chrisseaton 6y ago> Presumably a dynamic JIT like HotSpot would use this technique. Not in practice in HotSpot no, but it could do and similar VMs do. execute|write is not fashionable these days! Some systems enforce execute^write, so you can't do it.
- MaxBarraclough 6y ago> execute|write is not fashionable these days! Ah, of course! Hadn't thought of that.