Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23732>
* piece goes to the right locations. Thanks to the change in
* size, it may or may not still wrap around.
*/
- split = u_align_u32(vector->tail, vector->size);
+ split = align(vector->tail, vector->size);
assert(vector->tail <= split && split < vector->head);
memcpy((char *)data + dst_tail, (char *)vector->data + src_tail,
split - vector->tail);
extern "C" {
#endif
-/* TODO - move to u_math.h - name it better etc */
-static inline uint32_t
-u_align_u32(uint32_t v, uint32_t a)
-{
- assert(a != 0 && a == (a & -((int32_t) a)));
- return (v + a - 1) & ~(a - 1);
-}
-
struct u_vector {
uint32_t head;
uint32_t tail;