def align_to_mmap(num, round_up):
 res = ((num / ALLOCATIONGRANULARITY) * ALLOCATIONGRANULARITY)
 if (round_up and (res != num)):
  res += ALLOCATIONGRANULARITY
 return res

def align_to_mmap ( num , round_up ) : res = ( ( num / ALLOCATIONGRANULARITY ) * ALLOCATIONGRANULARITY ) if ( round_up and ( res != num ) ) : res += ALLOCATIONGRANULARITY return res
align the given integer number to the closest page offset .