fix align_as_and_cast

This commit is contained in:
Wenyong Huang 2024-04-07 11:12:01 +08:00
parent 3019a03431
commit f6f5c9fef3

View File

@ -41,12 +41,12 @@ static void (*free_func)(void *ptr) = NULL;
static unsigned int global_pool_size;
static uint32
static uint64
align_as_and_cast(uint64 size, uint64 alignment)
{
uint64 aligned_size = (size + alignment - 1) & ~(alignment - 1);
return aligned_size > UINT32_MAX ? UINT32_MAX : (uint32)aligned_size;
return aligned_size;
}
static bool