Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/heap.cpython-311.opt-2.pyc
�

�,dj-��"�ddlZddlmZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZdgZ
ejdkrddlZGd�d	e��Zn%Gd
�d	e��Zd�Zd�Ze	jee��Gd
�de��ZGd�de��ZdS)�N)�defaultdict�)�	reduction�assert_spawning)�util�
BufferWrapper�win32c�@�eZdZ	ej��Zd�Zd�Zd�ZdS)�Arenac�t�||_td��D]p}dtj��t	|j��fz}t
jd||���}tj��dkrn$|�	���qtd���||_||_|j|jf|_
dS)N�dz	pym-%d-%s�����tagnamerzCannot find name for new mmap)�size�range�os�getpid�next�_rand�mmap�_winapi�GetLastError�close�FileExistsError�name�buffer�_state)�selfr�ir�bufs     �;/opt/alt/python311/lib64/python3.11/multiprocessing/heap.py�__init__zArena.__init__&s����D�I��3�Z�Z�
G�
G��"�b�i�k�k�4��
�3C�3C�%D�D���i��D�$�7�7�7���'�)�)�Q�.�.��E��	�	�����%�&E�F�F�F��D�I��D�K��9�d�i�0�D�K�K�K�c�.�t|��|jS�N)rr)rs r"�__getstate__zArena.__getstate__5s���D�!�!�!��;�r$c�~�|x\|_|_|_tjd|j|j���|_dS)Nrr)rrrrr)r�states  r"�__setstate__zArena.__setstate__9s7��16�6� �D�I�t�y�4�;��)�B��	�4�9�E�E�E�D�K�K�Kr$N)	�__name__�
__module__�__qualname__�tempfile�_RandomNameSequencerr#r'r*�r$r"rrs]������	�-��,�.�.��
	1�
	1�
	1�	�	�	�	F�	F�	F�	F�	Fr$rc�@�eZdZ	ejdkrdgZngZdd�Zd�ZdS)r�linuxz/dev/shmrc��||_||_|dkr�tjdt	j��z|�|�����\|_}t	j|��tj	|tj
|jf��t	j|j|��tj|j|j��|_
dS)Nrzpym-%d-)�prefix�dir)r�fdr.�mkstemprr�_choose_dir�unlinkr�Finalizer�	ftruncaterr)rrr6rs    r"r#zArena.__init__Ms����D�I��D�G��R�x�x�!)� 0�%�b�i�k�k�1��)�)�$�/�/�!1�!1�!1�
�����	�$�����
�d�B�H�t�w�j�9�9�9���T�W�d�+�+�+��)�D�G�T�Y�7�7�D�K�K�Kr$c��|jD]-}tj|��}|j|jz|kr|cS�.tj��Sr&)�_dir_candidatesr�statvfs�f_bavail�f_frsizer�get_temp_dir)rr�d�sts    r"r8zArena._choose_dir[sT���)�
�
���Z��]�]���;���,��4�4��H�H�H�5��$�&�&�&r$N)r)r+r,r-�sys�platformr=r#r8r0r$r"rrCsY������	��<�7�"�"�)�l�O�O� �O�	8�	8�	8�	8�	'�	'�	'�	'�	'r$c��|jdkrtd���t|jt	j|j��ffS)NrzDArena is unpicklable because forking was enabled when it was created)r6�
ValueError�
rebuild_arenarr�DupFd)�as r"�reduce_arenarKdsF���4�2�:�:��G�H�H�
H��q�v�y��q�t�'<�'<�=�=�=r$c�F�t||�����Sr&)r�detach)r�dupfds  r"rHrHjs���T�5�<�<�>�>�*�*�*r$c�z�eZdZdZdZdZejfd�Ze	d���Z
d�Zd�Zd�Z
d�Zd	�Zd
�Zd�Zd�Zd
�ZdS)�Heap�i@c��tj��|_tj��|_||_g|_i|_i|_	i|_
tt��|_
g|_g|_d|_d|_dS�Nr)rr�_lastpid�	threading�Lock�_lock�_size�_lengths�_len_to_seq�_start_to_block�_stop_to_blockr�set�_allocated_blocks�_arenas�_pending_free_blocks�
_n_mallocs�_n_frees)rrs  r"r#z
Heap.__init__{s����	����
��^�%�%��
���
���
���� "���!���"-�S�!1�!1������%'��!������
�
�
r$c��|dz
}||z|zS)Nrr0)�n�	alignment�masks   r"�_roundupz
Heap._roundup�s���1�}���D��T�E�!�!r$c�.�|�t|j|��tj��}|j|jkr|xjdzc_t
jd|��t|��}|j	�
|��|d|fS)N�z"allocating a new mmap of length %dr)rg�maxrXr�PAGESIZE�_DOUBLE_ARENA_SIZE_UNTILr�inforr_�append)rr�length�arenas    r"�
_new_arenazHeap._new_arena�s������s�4�:�t�4�4�d�m�D�D���:��5�5�5��J�J�!�O�J�J��	�6��?�?�?��f�
�
������E�"�"�"��q�&�!�!r$c�T�|j}||jkrdS|j�|��}|j|df=|j||f=|j�|��|j|}|�|d|f��|s$|j|=|j	�|��dSdSrS)
r�_DISCARD_FREE_SPACE_LARGER_THANr^�popr[r\r_�removerZrY)rrpro�blocks�seqs     r"�_discard_arenazHeap._discard_arena�s�������D�8�8�8��F��'�+�+�E�2�2��� �%���,������0�����E�"�"�"���v�&���
�
�E�1�f�%�&�&�&��	)�� ��(��M� � ��(�(�(�(�(�	)�	)r$c�H�tj|j|��}|t|j��kr|�|��S|j|}|j|}|���}|s|j|=|j|=|\}}}|j||f=|j||f=|Sr&)	�bisect�bisect_leftrY�lenrqrZrtr[r\)	rrr rorw�blockrp�start�stops	         r"�_malloczHeap._malloc�s�����t�}�d�3�3����D�M�"�"�"�"��?�?�4�(�(�(��]�1�%�F��"�6�*�C��G�G�I�I�E��
?��$�V�,�d�m�A�.>�$����t�� �%���0�����
�.��r$c���|\}}}	|j||f}|�|��\}}n#t$rYnwxYw	|j||f}|�|��\}}n#t$rYnwxYw|||f}||z
}	|j|�|��n5#t$r(|g|j|<t
j|j|��YnwxYw||j||f<||j||f<dSr&)	r\�_absorb�KeyErrorr[rZrnrz�insortrY)	rr}rpr~r�
prev_block�_�
next_blockros	         r"�_add_free_blockzHeap._add_free_block�sY��$����t�	0��,�e�U�^�<�J��|�|�J�/�/�H�E�1�1���	�	�	��D�	����
	/��-�u�d�m�<�J��l�l�:�.�.�G�A�t�t���	�	�	��D�	����
��t�$������	1���V�$�+�+�E�2�2�2�2���	1�	1�	1�(-�w�D��V�$��M�$�-��0�0�0�0�0�	1����05���e�U�^�,�-2���U�D�M�*�*�*s0�0�
=�=�A)�)
A6�5A6� B%�%/C�Cc���|\}}}|j||f=|j||f=||z
}|j|}|�|��|s"|j|=|j�|��||fSr&)r[r\rZrurY)rr}rpr~rrorws       r"r�zHeap._absorb�s���$����t�� �%���0�����
�.�������v�&���
�
�5�����	)�� ��(��M� � ��(�(�(��d�{�r$c��|\}}}|j|}|�||f��|s|�|��dSdSr&)r^rurx)rr}rpr~rrvs      r"�_remove_allocated_blockzHeap._remove_allocated_block�s]��"���u�d��'��.���
�
�u�d�m�$�$�$��	'�����&�&�&�&�&�	'�	'r$c��		|j���}n#t$rYdSwxYw|�|��|�|���Wr&)r`rt�
IndexErrorr�r��rr}s  r"�_free_pending_blockszHeap._free_pending_blockssq��	0�
��1�5�5�7�7�����
�
�
����
����� � ��'�'�'��(�(��/�/�/�
	0s��
+�+c�(�tj��|jkr9td�tj��|j�����|j�d��s|j�|��dS	|xj	dz
c_	|�
��|�|��|�|��|j�
��dS#|j�
��wxYw)Nz$My pid ({0:n}) is not last pid {1:n}Fr)rrrTrG�formatrW�acquirer`rnrbr�r�r��releaser�s  r"�freez	Heap.frees���9�;�;�$�-�'�'��6�=�=��I�K�K��
�/�/�0�0�
0��z�!�!�%�(�(�	%�
�%�,�,�U�3�3�3�3�3�
%��
�
��"�
�
��)�)�+�+�+��$�$�U�+�+�+��,�,�U�3�3�3��
�"�"�$�$�$�$�$���
�"�"�$�$�$�$���s
�
AC6�6Dc��|dkr"td�|�����tj|kr"t	d�|�����tj��|jkr|���|j	5|xj
dz
c_
|���|�t|d��|j��}|�|��\}}}||z}||kr|�|||f��|j|�||f��|||fcddd��S#1swxYwYdS)Nr�Size {0:n} out of range�Size {0:n} too larger)rGr�rD�maxsize�
OverflowErrorrrrTr#rWrar�rgrj�
_alignmentr�r�r^�add)rrrpr~r�	real_stops      r"�malloczHeap.malloc(s����!�8�8��6�=�=�d�C�C�D�D�D��;�$���� 6� =� =�d� C� C�D�D�D�
�9�;�;�$�-�'�'��M�M�O�O�O�
�Z�	-�	-��O�O�q� �O�O��%�%�'�'�'��=�=��T�1���t��?�?�D�#'�<�<��#5�#5� �U�E�4����I��4����$�$�e�Y��%=�>�>�>��"�5�)�-�-�u�i�.@�A�A�A��5�)�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-�	-�	-s�B0E�E�EN)r+r,r-r�rsrlrrkr#�staticmethodrgrqrxr�r�r�r�r�r�r�r0r$r"rPrPss��������J�&3�#�,�� �M�����:�"�"��\�"�

"�
"�
"�)�)�)�$���"3�3�3�<
�
�
�'�'�'�0�0�0�%�%�%�8-�-�-�-�-r$rPc�.�eZdZe��Zd�Zd�ZdS)rc�X�|dkr"td�|�����tj|kr"t	d�|�����t
j�|��}||f|_tj
|t
jj|f���dS)Nrr�r�)�args)rGr�rDr�r�r�_heapr�rrr:r�)rrr}s   r"r#zBufferWrapper.__init__Fs����!�8�8��6�=�=�d�C�C�D�D�D��;�$���� 6� =� =�d� C� C�D�D�D��#�*�*�4�0�0���d�m����
�d�M�/�4�E�8�D�D�D�D�D�Dr$c�\�|j\\}}}}t|j��|||z�Sr&)r�
memoryviewr)rrpr~rrs     r"�create_memoryviewzBufferWrapper.create_memoryviewOs3��%)�[�"����t�d��%�,�'�'��e�D�j�(8�9�9r$N)r+r,r-rPr�r#r�r0r$r"rrBs@�������D�F�F�E�E�E�E�:�:�:�:�:r$)rz�collectionsrrrrDr.rU�contextrr�r�__all__rEr�objectrrKrH�registerrPrr0r$r"�<module>r�s����
�
�
�#�#�#�#�#�#�����	�	�	�	�
�
�
�
���������/�/�/�/�/�/�/�/��������
���<�7����N�N�N�F�F�F�F�F��F�F�F�F�H'�'�'�'�'��'�'�'�B>�>�>�+�+�+��I��u�l�+�+�+�I-�I-�I-�I-�I-�6�I-�I-�I-�^:�:�:�:�:�F�:�:�:�:�:r$

ZeroDay Forums Mini