pub fn init_with_buffer_size(num_bytes: usize) -> crate::Result<Soc> {
        unsafe {
            let soc_mem = memalign(0x1000, num_bytes) as *mut u32;

            let r = socInit(soc_mem, num_bytes as u32);
            if r < 0 {
                free(soc_mem as *mut _);
                Err(r.into())
            } else {
                Ok(Soc { soc_mem })
            }
        }
    }
/// Initialize the Soc service with a custom buffer size in bytes. The size should be
/// 0x100000 bytes or greater.
///
/// # Errors
///
/// This function will return an error if the `Soc` service is already initialized
Initialize the Soc service with a custom buffer size in bytes. The size should be
0x100000 bytes or greater.
Initialize the Soc service with a custom buffer size in bytes . The size should be 0x100000 bytes or greater .
pub fn init_with_buffer_size(num_bytes: usize) -> crate::Result<Soc> {
        unsafe {
            let soc_mem = memalign(0x1000, num_bytes) as *mut u32;
            let r = socInit(soc_mem, num_bytes as u32);
            if r < 0 {
                free(soc_mem as *mut _);
                Err(r.into())
            } else {
                Ok(Soc { soc_mem })
            }
        }
    }
pub fn init_with_buffer_size ( num_bytes : usize ) -> crate :: Result < Soc > { unsafe { let soc_mem = memalign ( 0x1000 , num_bytes ) as * mut u32 ; let r = socInit ( soc_mem , num_bytes as u32 ) ; if r < 0 { free ( soc_mem as * mut _ ) ; Err ( r . into ( ) ) } else { Ok ( Soc { soc_mem } ) } } }
Initialize the Soc service with a custom buffer size in bytes.
Initialize the Soc service with a custom buffer size in bytes .
num_bytes
usize
num_bytes
usize
errors
This function will return an error if the `Soc` service is already initialized
This function will return an error if the ` Soc ` service is already initialized