Ejemplo n.º 1
0
/*
 * Round down to the nearest chunk size that can actually be requested during
 * normal huge allocation.
 */
JEMALLOC_INLINE_C size_t
extent_quantize(size_t size)
{
	size_t ret;
	szind_t ind;

	assert(size > 0);

	ind = size2index(size + 1);
	if (ind == 0) {
		/* Avoid underflow. */
		return (index2size(0));
	}
	ret = index2size(ind - 1);
	assert(ret <= size);
	return (ret);
}
Ejemplo n.º 2
0
JEMALLOC_INLINE_C size_t
extent_quantize(size_t size)
{

	/*
	 * Round down to the nearest chunk size that can actually be requested
	 * during normal huge allocation.
	 */
	return (index2size(size2index(size + 1) - 1));
}