pub fn allocate(size: usize) -> Result<SharedMemory, AllocError> {
        assert!(size != 0);
        assert!(size % allocation_granularity() == 0);
        unsafe {
            let id = shmget(IPC_PRIVATE, size, IPC_CREAT | 448);
            if id == -1 {
                print_error("shmget");
                return Err(AllocError::Oom);
            }
            Ok(SharedMemory { id })
        }
    }
/// Allocates `size` bytes of inter-process shared memory.
///
/// Return the handle to this shared memory.
///
/// # Panics
///
/// If `size` is zero or not a multiple of the allocation granularity.
Allocates `size` bytes of inter-process shared memory.
Return the handle to this shared memory.
Allocates ` size ` bytes of inter - process shared memory . Return the handle to this shared memory .
pub fn allocate(size: usize) -> Result<SharedMemory, AllocError> {
        assert!(size != 0);
        assert!(size % allocation_granularity() == 0);
        unsafe {
            let id = shmget(IPC_PRIVATE, size, IPC_CREAT | 448);
            if id == -1 {
                print_error("shmget");
                return Err(AllocError::Oom);
            }
            Ok(SharedMemory { id })
        }
    }
pub fn allocate ( size : usize ) -> Result < SharedMemory , AllocError > { assert ! ( size 0 ) ; assert ! ( size allocation_granularity ( ) 0 ) ; unsafe { let id = shmget ( IPC_PRIVATE , size , IPC_CREAT | 448 ) ; if id == - 1 { print_error ( " " ) ; return Err ( AllocError :: Oom ) ; } Ok ( SharedMemory { id } ) } }
Allocates `size` bytes of inter-process shared memory.
Allocates ` size ` bytes of inter - process shared memory .
size
usize
size
usize
panics
If `size` is zero or not a multiple of the allocation granularity.
If ` size ` is zero or not a multiple of the allocation granularity .