link-grammar-5.8.0/link-grammar/memory-pool.c
/**
 * Align given size to the nearest upper power of 2
 * for size<MAX_ALIGNMENT, else to MIN_ALIGNMENT.
 */
Align given size to the nearest upper power of 2
for size<MAX_ALIGNMENT, else to MIN_ALIGNMENT.
Align given size to the nearest upper power of 2 for size<MAX_ALIGNMENT else to MIN_ALIGNMENT .
static size_t align_size(size_t element_size)
{
	if (element_size < MAX_ALIGNMENT)
	{
		size_t s = next_power_of_two_up(element_size);
		if (s != element_size)
			element_size = ALIGN(element_size, s);
	}
	else
	{
		element_size = ALIGN(element_size, MIN_ALIGNMENT);
	}
	return element_size;
}
static size_t align_size ( size_t element_size ) { if ( element_size < MAX_ALIGNMENT ) { size_t s = next_power_of_two_up ( element_size ) ; if ( s != element_size ) element_size = ALIGN ( element_size , s ) ; } else { element_size = ALIGN ( element_size , MIN_ALIGNMENT ) ; } return element_size ; }
Align given size to the nearest upper power of 2
 for size<MAX_ALIGNMENT, else to MIN_ALIGNMENT.
Align given size to the nearest upper power of 2 for size<MAX_ALIGNMENT else to MIN_ALIGNMENT .