pub fn new(size: usize) -> Result<Self, &'static str> {
        match size {
            0 => Err("Buffer size must be greater than 0"),
            _ if ((size - 1) & size) == 0 =>
                Ok(DynamicBufferP2{ptr: alloc(size), mask: size - 1}),
            _ => Err("Buffer size must be a power of two")
        }
    }
/// Create a new `DynamicBufferP2` of the given size. This method will
/// return an error if the requested number of bytes could not be
/// allocated or size is not a power of two.
Create a new `DynamicBufferP2` of the given size. This method will
return an error if the requested number of bytes could not be
allocated or size is not a power of two.
Create a new ` DynamicBufferP2 ` of the given size . This method will return an error if the requested number of bytes could not be allocated or size is not a power of two .
pub fn new(size: usize) -> Result<Self, &'static str> {
        match size {
            0 => Err("Buffer size must be greater than 0"),
            _ if ((size - 1) & size) == 0 =>
                Ok(DynamicBufferP2{ptr: alloc(size), mask: size - 1}),
            _ => Err("Buffer size must be a power of two")
        }
    }
pub fn new ( size : usize ) -> Result < Self , & ' static str > { match size { 0 => Err ( " " ) , _ if ( ( size - 1 ) & size ) == 0 => Ok ( DynamicBufferP2 { ptr : alloc ( size ) , mask : size - 1 } ) , _ => Err ( " " ) } }
Create a new `DynamicBufferP2` of the given size.
Create a new ` DynamicBufferP2 ` of the given size .
size
usize
size
usize