code: def align_to_mmap(num, round_up):
      
      res = (num // ALLOCATIONGRANULARITY) * ALLOCATIONGRANULARITY
      if round_up and (res != num):
          res += ALLOCATIONGRANULARITY
      # END handle size
      return res
docs: Align the given integer number to the closest page offset, which usually is 4096 bytes.
  
      :param round_up: if True, the next higher multiple of page size is used, otherwise
          the lower page_size will be used (i.e. if True, 1 becomes 4096, otherwise it becomes 0)
      :return: num rounded to closest page