You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mem_util.rs
    path of file: ./repos/occlum/src/libos/src/util
    
    the code of the file until where you have to start completion: use super::*;
use std::ffi::{CStr, CString};
use std::mem::size_of;
use std
    
    pub fn check_array<T>(out_ptr: *const T, count: usize) -> Result<()> {
        let checked_len = count
            .checked_mul(size_of::<T>())
            .ok_or_else(|| errno!(EINVAL, "the array is too long"))?;
        if !sgx_trts::trts::rsgx_raw_is_outside_enclave(out_ptr as *const u8, checked_len) {
            return_errno!(EFAULT, "the whole buffer is not outside enclave");
        }
        Ok(())
    }