Closures/Value capture: Difference between revisions

Content added Content deleted
Line 8: Line 8:
===Function image copying approach===
===Function image copying approach===


Non-portable. Copying a function body depends on implementation-specific semantics of volatile, if the replacement target still exists afte optimization, if the dest memory is suitably aligned, if the memory is executable, if it makes any function calls to a relative offset, if it refers to any memory location with an absolute address, etc. It only very occasionally works.
Non-portable. Copying a function body depends on implementation-specific semantics of volatile, if the replacement target still exists after optimization, if the dest memory is suitably aligned, if the memory is executable, if it makes any function calls to a relative offset, if it refers to any memory location with an absolute address, etc. It only very occasionally works.


<lang c>#include <stdio.h>
<lang c>#include <stdio.h>