Function alignAllocLen [src]
An allocator helper function. Adjusts an allocation length satisfy len_align.
full_len should be the full capacity of the allocation which may be greater
than the len that was requested. This function should only be used by allocators
that are unaffected by len_align.
Prototype
pub fn alignAllocLen(full_len: usize, alloc_len: usize, len_align: u29) usize
Parameters
full_len: usize
alloc_len: usize
len_align: u29
Source
pub fn alignAllocLen(full_len: usize, alloc_len: usize, len_align: u29) usize {
assert(alloc_len > 0);
assert(alloc_len >= len_align);
assert(full_len >= alloc_len);
if (len_align == 0)
return alloc_len;
const adjusted = alignBackwardAnyAlign(usize, full_len, len_align);
assert(adjusted >= alloc_len);
return adjusted;
}