#include #ifdef __APPLE__ /* On Darwin the packed body is copied into JIT memory at run time, so the run-time bootstrap uses mmap / pthread_jit_write_protect_np / sys_icache_invalidate. On Linux the code is decrypted in place and none of these are needed. */ #include #include #include #include #endif int work(int n) { int s; int i; s = 0; for (i = 0; i < n; i++) { s += i * 3; } return s; } int main(void) { int r; r = work(10); printf("work(10)=%d\n", r); return 0; }