Lines Matching refs:align
484 static size_t align_up(size_t x, size_t align) in align_up() argument
486 tlsf_assert(0 == (align & (align - 1)) && "must align to a power of two"); in align_up()
487 return (x + (align - 1)) & ~(align - 1); in align_up()
490 static size_t align_down(size_t x, size_t align) in align_down() argument
492 tlsf_assert(0 == (align & (align - 1)) && "must align to a power of two"); in align_down()
493 return x - (x & (align - 1)); in align_down()
496 static void * align_ptr(const void * ptr, size_t align) in align_ptr() argument
499 (tlsf_cast(tlsfptr_t, ptr) + (align - 1)) & ~(align - 1); in align_ptr()
500 tlsf_assert(0 == (align & (align - 1)) && "must align to a power of two"); in align_ptr()
508 static size_t adjust_request_size(size_t size, size_t align) in adjust_request_size() argument
512 const size_t aligned = align_up(size, align); in adjust_request_size()
1105 void * lv_tlsf_memalign(lv_tlsf_t tlsf, size_t align, size_t size) in lv_tlsf_memalign() argument
1119 const size_t size_with_gap = adjust_request_size(adjust + align + gap_minimum, align); in lv_tlsf_memalign()
1125 const size_t aligned_size = (adjust && align > ALIGN_SIZE) ? size_with_gap : adjust; in lv_tlsf_memalign()
1134 void * aligned = align_ptr(ptr, align); in lv_tlsf_memalign()
1141 const size_t offset = tlsf_max(gap_remain, align); in lv_tlsf_memalign()
1145 aligned = align_ptr(next_aligned, align); in lv_tlsf_memalign()