def allocated_size(allocation_unit, requested_size):
 allocation_unit = int(allocation_unit)
 requested_size = int(requested_size)
 previous_interval_size = ((requested_size // allocation_unit) * allocation_unit)
 if (previous_interval_size < requested_size):
  return (previous_interval_size + allocation_unit)
 else:
  return requested_size

def allocated_size ( allocation_unit , requested_size ) : allocation_unit = int ( allocation_unit ) requested_size = int ( requested_size ) previous_interval_size = ( ( requested_size // allocation_unit ) * allocation_unit ) if ( previous_interval_size < requested_size ) : return ( previous_interval_size + allocation_unit ) else : return requested_size
round requested_size up to the nearest allocation_unit .