pub unsafe extern "C" fn dr_flush_region_ex(
start: app_pc,
size: usize,
flush_completion_callback: Option<unsafe extern "C" fn(user_data: *mut c_void)>,
user_data: *mut c_void,
) -> bool_Expand description
Flush all fragments containing any code from the region [\p start, \p start + \p size). Once this routine returns no execution will occur out of the fragments flushed. This routine may only be called during a clean call from the cache, from a nudge event handler, or from a pre- or post-system call event handler. It may not be called from any other event callback. No locks can held when calling this routine. If called from a clean call, caller can NOT return to the cache (the fragment that was called out of may have been flushed even if it doesn’t apparently overlap the flushed region). Instead the caller must redirect execution via dr_redirect_execution() (or DR_SIGNAL_REDIRECT from a signal callback) after this routine to continue execution. Returns true if successful.
\note This routine may not be called from any registered event callback other than the nudge event, the pre- or post-system call events, the exception event, or the signal event; clean calls out of the cache may call this routine.
\note If called from a clean call, caller must continue execution by calling dr_redirect_execution() after this routine, as the fragment containing the callout may have been flushed. The context to use can be obtained via dr_get_mcontext() with the exception of the pc to continue at which must be passed as an argument to the callout (see instr_get_app_pc()) or otherwise determined.
\note This routine may not be called while any locks are held that could block a thread processing a registered event callback or cache callout.
\note dr_delay_flush_region() has fewer restrictions on use, but is less synchronous.
\note Use \p size == 1 to flush fragments containing the instruction at address \p start. A flush of \p size == 0 is not allowed.
\note Use flush_completion_callback to specify logic to be executed after the flush and before the threads are resumed. Use NULL if not needed.
\note As currently implemented, dr_delay_flush_region() with no completion callback routine specified can be substantially more performant.