File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/smmap/__pycache__/util.cpython-311.opt-1.pyc
�
    � h>  �                   �   � d Z ddlZddlZddlmZmZ ddlmZ g d�Zd� Zd� Z G d� d	�  �        Z	 G d
� d�  �        Z
 G d� d
e�  �        ZdS )zlModule containing a memory memory manager which provides a sliding window on a number of memory mapped files�    N)�mmap�ACCESS_READ��ALLOCATIONGRANULARITY)�
align_to_mmap�	is_64_bit�	MapWindow�	MapRegion�
MapRegionListr   c                 �N   � | t           z  t           z  }|r|| k    r
|t           z
  }|S )a=  
    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 pager   )�num�round_up�ress      �?/opt/cloudlinux/venv/lib/python3.11/site-packages/smmap/util.pyr   r      s5   � � �'�'�+@�
@�C�� %�S�C�Z�Z��$�$���J�    c                  �"