4|
Op d Z ddlZddlZddlmZmZ ddlmZ g dZd 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)mmapACCESS_READALLOCATIONGRANULARITY)
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 )numround_upress \/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/smmap/util.pyr r s5 ''+@
@C %SCZZ$$J c " t j dk S )zO:return: True if the system is 64 bit. Otherwise it can be assumed to be 32 bitl )sysmaxsize r r r r s ;&&r c P e Zd ZdZdZd Zd Zed Zd Z d Z
d Zd Zd
S )r zWUtility type which is used to snap windows towards each other, and to adjust their sizeofssizec " || _ || _ d S Nr )selfoffsetr s r __init__zMapWindow.__init__- s r c $ d| j | j fz S )NzMapWindow(%i, %i)r r s r __repr__zMapWindow.__repr__1 s "dh %:::r c H | |j | S )z!:return: new window from a region_br )clsregions r from_regionzMapWindow.from_region4 s s69fkkmm,,,r c | j | j z S r r r s r ofs_endzMapWindow.ofs_end9 s x$)##r c t | j d }| xj | j |z
z
c_ || _ t | j d | _ dS )z