| 740 | } |
| 741 | |
| 742 | bool Process::flushCache(const void* target, size_t count) |
| 743 | { |
| 744 | #ifndef WIN32 |
| 745 | #ifndef _DARWIN |
| 746 | __builtin___clear_cache((char*)target, (char*)target + count - 1); |
| 747 | return true; /* assume always succeeds, as the builtin has no return type */ |
| 748 | #else /* _DARWIN */ |
| 749 | // FIXME: implement cache flush for MacOS (???) |
| 750 | return false; |
| 751 | #endif /* _DARWIN */ |
| 752 | #else /* WIN32 */ |
| 753 | return 0 != FlushInstructionCache(d->my_handle, (LPCVOID)target, count); |
| 754 | #endif /* WIN32 */ |
| 755 | } |
| 756 | |
| 757 | #ifndef WIN32 |
| 758 | // returns -1 on error |