pub unsafe fn register_sigbus_handler(&self, handler: SignalHandler) -> Result<()> {
        let mut sa = MemoryManager::sigaction(handler);
        sigemptyset(&mut sa.sa_mask as *mut _);

        let signal = if cfg!(target_os = "macos") {
            libc::SIGBUS
        } else if cfg!(target_os = "linux") {
            libc::SIGSEGV
        } else {
            panic!("Unsupported platform")
        };

        if sigaction(signal, &sa as *const _, ptr::null_mut()) == -1 {
            return composer_err!("Composer initialization failed: could not intercept SIGBUS");
        } else if sa.sa_sigaction == SIG_DFL {
            return composer_err!("Composer initialization failed: SIGBUS handled with default behavior");
        } else if sa.sa_sigaction == SIG_IGN {
            return composer_err!("Composer initialization failed: SIGBUS is ignored");
        }
        Ok(())
    }
/// Register a signal handler for this `MemoryManager`.
Register a signal handler for this `MemoryManager`.
Register a signal handler for this ` MemoryManager ` .
pub unsafe fn register_sigbus_handler(&self, handler: SignalHandler) -> Result<()> {
        let mut sa = MemoryManager::sigaction(handler);
        sigemptyset(&mut sa.sa_mask as *mut _);
        let signal = if cfg!(target_os = "macos") {
            libc::SIGBUS
        } else if cfg!(target_os = "linux") {
            libc::SIGSEGV
        } else {
            panic!("Unsupported platform")
        };
        if sigaction(signal, &sa as *const _, ptr::null_mut()) == -1 {
            return composer_err!("Composer initialization failed: could not intercept SIGBUS");
        } else if sa.sa_sigaction == SIG_DFL {
            return composer_err!("Composer initialization failed: SIGBUS handled with default behavior");
        } else if sa.sa_sigaction == SIG_IGN {
            return composer_err!("Composer initialization failed: SIGBUS is ignored");
        }
        Ok(())
    }
pub unsafe fn register_sigbus_handler ( & self , handler : SignalHandler ) -> Result < ( ) > { let mut sa = MemoryManager :: sigaction ( handler ) ; sigemptyset ( & mut sa . sa_mask as * mut _ ) ; let signal = if cfg ! ( target_os " " ) { libc :: SIGBUS } else if cfg ! ( target_os " " ) { libc :: SIGSEGV } else { panic ! ( " " ) } ; if sigaction ( signal , & sa as * const _ , ptr :: null_mut ( ) ) == - 1 { return composer_err ! ( " " ) ; } else if sa . sa_sigaction == SIG_DFL { return composer_err ! ( " " ) ; } else if sa . sa_sigaction == SIG_IGN { return composer_err ! ( " " ) ; } Ok ( ( ) ) }
Register a signal handler for this `MemoryManager`.
Register a signal handler for this ` MemoryManager ` .
&self
handler
SignalHandler