FTR, that's what mono does (for an equivalent to sync_instruction_memory (code, size);): guint64 *p = (guint64*)code; guint64 *end = (guint64*)(code + ((size + 8) /8));
/* * FIXME: Flushing code in dword chunks in _slow_. */ while (p < end) #ifdef __GNUC__ __asm__ __volatile__ ("iflush %0"::"r"(p++)); #else flushi (p ++); #endif
FTR, that's what mono does (for an equivalent to sync_instructio n_memory (code, size);):
guint64 *p = (guint64*)code;
guint64 *end = (guint64*)(code + ((size + 8) /8));
/*
* FIXME: Flushing code in dword chunks in _slow_.
*/
while (p < end)
#ifdef __GNUC__
__asm__ __volatile__ ("iflush %0"::"r"(p++));
#else
flushi (p ++);
#endif