/// Returns a ptr to the slot after `next`.
/// When `next` points to the lowest slot in it's Arena block
/// the block is full, and a ptr to header will be returned.
/// `next` must be aligned!
Returns a ptr to the slot after `next`.
When `next` points to the lowest slot in it's Arena block
the block is full, and a ptr to header will be returned.
`next` must be aligned!
Returns a ptr to the slot after ` next ` . When ` next ` points to the lowest slot in it ' s Arena block the block is full and a ptr to header will be returned . ` next ` must be aligned!
pub(crate) fn bump_down(next: *const u8, size: u16, align: u16) -> *const u8 {
    // TODO inspect generated code to ensure `next % align` is only being calculated once,
    // when caller compares `bump_down(next)` to `Header::from(next)`.
    let header = HeaderUnTyped::from(next);
    let low = header as usize + HeaderUnTyped::low_offset(align) as usize;
    // TODO does this generate better ASM than min(next', low)?
    if low == next as usize {
        header as *const u8
    } else {
        ((next as usize) - size as usize) as *const u8
    }
}
pub ( crate ) fn bump_down ( next : * const u8 , size : u16 , align : u16 ) -> * const u8 { // TODO inspect generated code to ensure `next % align` is only being calculated once, // when caller compares `bump_down(next)` to `Header::from(next)`. let header = HeaderUnTyped :: from ( next ) ; let low = header as usize + HeaderUnTyped :: low_offset ( align ) as usize ; // TODO does this generate better ASM than min(next', low)? if low == next as usize { header as * const u8 } else { ( ( next as usize ) - size as usize ) as * const u8 } }
Returns a ptr to the slot after `next`.
Returns a ptr to the slot after ` next ` .
next
*const u8
size
u16
align
u16