pub unsafe fn register(ir_interval: i64, cycles_interval: i64, handler: fn(i64)) {
    LocalLC += ci_ir_interval as i32;
    ci_ir_interval = ir_interval;
    ci_reset_ir_interval = ir_interval / 2;
    ci_cycles_interval = cycles_interval;
    ci_cycles_threshold = (0.9 * cycles_interval as f64) as i64;
    int_handler = handler;
    intvActionHook = interrupt_handler;
}
/// Registers a handler for Compiler Interrupts.
///
/// This function takes a IR interval, cycles interval, and
/// function pointer to the Compiler Interrupts handler.
/// The handler receives an approximation of the number of IR instructions
/// since the last interrupt as the argument.
///
/// # Note
///
/// This function is thread-specific, which means it only registers
/// on the thread they called on.
///
/// This function should not be called multiple times.
/// Consecutive calls will override the previous intervals and handler.
///
/// # Safety
///
/// This function mutates a thread-local static variable which uses for the interrupt handler.
/// Thread unsafety will not be introduced. However, calling the handler outside Rust would
/// probably violate Rust's safe memory model; hence the function is considered unsafe.
///
/// # Examples
///
/// ```
/// fn interrupt_handler(ic: i64) {
///     println!("Compiler interrupt called with instruction count: {}", ic);
/// }
///
/// unsafe {
///     compiler_interrupts::register(10000, 10000, interrupt_handler);
/// }
/// ```
Registers a handler for Compiler Interrupts.
This function takes a IR interval, cycles interval, and
function pointer to the Compiler Interrupts handler.
The handler receives an approximation of the number of IR instructions
since the last interrupt as the argument.
Registers a handler for Compiler Interrupts . This function takes a IR interval cycles interval and function pointer to the Compiler Interrupts handler . The handler receives an approximation of the number of IR instructions since the last interrupt as the argument .
pub unsafe fn register(ir_interval: i64, cycles_interval: i64, handler: fn(i64)) {
    LocalLC += ci_ir_interval as i32;
    ci_ir_interval = ir_interval;
    ci_reset_ir_interval = ir_interval / 2;
    ci_cycles_interval = cycles_interval;
    ci_cycles_threshold = (0.9 * cycles_interval as f64) as i64;
    int_handler = handler;
    intvActionHook = interrupt_handler;
}
pub unsafe fn register ( ir_interval : i64 , cycles_interval : i64 , handler : fn ( i64 ) ) { LocalLC += ci_ir_interval as i32 ; ci_ir_interval = ir_interval ; ci_reset_ir_interval = ir_interval / 2 ; ci_cycles_interval = cycles_interval ; ci_cycles_threshold = ( 0.9 * cycles_interval as f64 ) as i64 ; int_handler = handler ; intvActionHook = interrupt_handler ; }
Registers a handler for Compiler Interrupts.
Registers a handler for Compiler Interrupts .
ir_interval
i64
cycles_interval
i64
handler
fn(i64)
note
This function is thread-specific, which means it only registers
on the thread they called on.

This function should not be called multiple times.
Consecutive calls will override the previous intervals and handler.
This function is thread - specific which means it only registers on the thread they called on . This function should not be called multiple times . Consecutive calls will override the previous intervals and handler .
safety
This function mutates a thread-local static variable which uses for the interrupt handler.
Thread unsafety will not be introduced. However, calling the handler outside Rust would
probably violate Rust's safe memory model; hence the function is considered unsafe.
This function mutates a thread - local static variable which uses for the interrupt handler . Thread unsafety will not be introduced . However calling the handler outside Rust would probably violate Rust ' s safe memory model ; hence the function is considered unsafe .
examples
```
fn interrupt_handler(ic: i64) {
println!("Compiler interrupt called with instruction count: {}", ic);
}

unsafe {
compiler_interrupts::register(10000, 10000, interrupt_handler);
}
```
` ` ` fn interrupt_handler ( ic : i64 ) { println! ( " Compiler interrupt called with instruction count : {} " ic ) ; } unsafe { compiler_interrupts :: register ( 10000 10000 interrupt_handler ) ; } ` ` `