%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.12/test/libregrtest/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.12/test/libregrtest/__pycache__/refleak.cpython-312.pyc

�

���f=���ddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
	dd	lmZdedefd
�Zd�Zd�Zy#e$r
ddlZd
�ZY�wxYw)�N)�
isabstract)�Any)�support)�	os_helper�)�HuntRefleak)�clear_caches)�	_get_dumpc��td�|jD��}||j|j|jfS)Nc3�FK�|]}tj|����y�w�N)�weakref�ref)�.0�objs  �//usr/lib/python3.12/test/libregrtest/refleak.py�	<genexpr>z_get_dump.<locals>.<genexpr>s����N�S����C� 0�N�s�!)�set�
_abc_registry�
_abc_cache�_abc_negative_cache�_abc_negative_cache_version)�cls�registry_weakrefss  rr
r
sA�� �N�C�<M�<M�N�N��!�3�>�>��'�'��)H�)H�J�	J��hunt_refleak�quietc
��4�ddl}ddl}ttd�st	d��t�tjdd}|jj�}tjj�}	ddl}	|	jj�}
i}|jjD�cgc]}t!|j|���c}D]8}
t#|
�s�|
j%�|
gzD]}t'|�d||<��:t)dd�D�cic]}||��c}�4�4fd�}|j*}|j,}|j.}||z}t1t)|��}dg|z}dg|z}dg|z}tj2}tj4}tj6}t8j:}dx}x}x}} |sUt=d|d	tj>�
�d|dzd
zzd|}!|!d|dz|!|dz}!t=|!tj>d��d}"tA||||
|�tCjD�|D]�}#|�}"tA||||
|�tCjD�|�}$|�|$z
}%|�|$dzz
}&|�}'||&|z
�||#<||%|z
�||#<||'|z
�||#<|sltG||#||#||#�}(|(dkrd})n
|(dkrd|(})nd})|#|k(rt=ddtj>d��t=|)dtj>d��~(~)|%}|&}|'}|$} ��|st=tj>�
�d�}*d�}+d},|d|*f|d|*f|d|+ffD]�\}-}.}/|-|d}-|/|-�}0tI|-�}1|0s|1s�$|�d|-�d|.�dtK|-���}2t=|2dtj>� �|0rRt=tj>d��tM|d!d"�#�5}3t=|2|3�
�|3jO�ddd�d},��t=d$tj>d����|,|"fS#t$rd}
Y���wxYwcc}wcc}w#1swY�JxYw)%z�Run a test multiple times, looking for reference leaks.

    Returns:
        False if the test didn't leak references; True if we detected refleaks.
    rN�gettotalrefcountz9Tracking reference leaks requires a debug build of Pythoni���i�c�(���j||�Sr
)�
setdefault)�value�int_pools �r�get_pooled_intz'runtest_refleak.<locals>.get_pooled_intEs����"�"�5�%�0�0r�	beginningzHrepetitions. Showing number of leaks (. for 0 or less, X for 10 or more))�file�
1234567890�
r�:T)r&�flush��.)
r,�1�2�3�4�5�6�7�8�9�X� �)�endr&r*c�&�td�|D��S)Nc3�&K�|]	}|dk\���y�w)rN�)r�deltas  rrz;runtest_refleak.<locals>.check_rc_deltas.<locals>.<genexpr>�s����2�%�5�A�:�2�s�)�all��deltass r�check_rc_deltasz(runtest_refleak.<locals>.check_rc_deltas�s���2�6�2�2�2rc��t|�Sr
)�anyr?s r�check_fd_deltasz(runtest_refleak.<locals>.check_fd_deltas�s���6�{�rF�
referencesz
memory blockszfile descriptorsz leaked z, sum=)r9r&�azutf-8)�encodingz (this is fine))(�copyreg�collections.abc�hasattr�sys�	Exception�warm_caches�warnings�filters�dispatch_table�copy�path_importer_cache�	zipimport�_zip_directory_cache�ImportError�abc�__all__�getattrr�__subclasses__r
�range�warmups�runs�filename�list�getallocatedblocksr�getunicodeinternedsizer�fd_count�print�stderr�dash_R_cleanupr�
gc_collect�maxrC�sum�openr*)5�	test_name�	test_funcrrrH�collections�fs�ps�picrS�zdc�abcsrFrVrr"r$r[r\r]�repcount�	rep_range�	rc_deltas�alloc_deltas�	fd_deltasr_rr`ra�	rc_before�alloc_before�	fd_before�interned_before�numbers�results�i�interned_after�alloc_after�rc_after�fd_after�total_leaks�symbolrArD�failedr@�	item_name�checker�failing�
suspicious�msg�refrepr#s5                                                    @r�runtest_refleakr�s�������3�*�+��$�%�	%�
�M�
�	�	�!�	�B�	�	�	�	$�	$�	&�B�

�
!�
!�
&�
&�
(�C�4��
�,�,�1�1�3��
�D�5@�_�_�5L�5L�M�������+�M�*���#����%�%�'�3�%�/�	*�C�!�#��q�)�D��I�	*�*�+0��t�*<�=���u��=�H�1��"�"�G����D��$�$�H���~�H��U�8�_�%�I���h��I��3��>�L���h��I��/�/���+�+�� �7�7���!�!�H�=>�>�I�>��>�y�?��
�k�8�&6��:�:�	� ��2���!1�2�I�X�>���(�7�#�c�)�G�G�H�,=�=��
�g�C�J�J�d�3��G��2�r�3��T�*�����
�')���+���r�2�s�C��.�����0�1��(�*�^�;��#�%���(:�:���:��%�h��&:�;�	�!��(��|�)C�D��Q��%�h��&:�;�	�!����i��l�L��O�Y�q�\�J�K��a�����r�!��!�#�����G�|��c�r��
�
�$�?��&�b�s�z�z��>���"���	��	�(��O')�R�
�3�:�:��
3���F�	�L�/�2�	���8�	�&��8�'�F�"��	�7����!���&�/����[�
��j��6�9�c�&�k�;�C��#�2�C�J�J�/���3�:�:�T�2��(�C�'�:�#�f��#�F�+��L�L�N�#����'�c�j�j��E�)F�*
�G����M������N��>�`#�#�s*�;P5�3Q�
Q�*Q�5Q�Q�Q	c�^�ddl}ddl}|tjdd|jj�|jj
|�tjj�tjj
|�	ddl	}|jj�|jj
|�|jjD�cgc]}t|j|���}	}tt |	�}	|	D]h}
|
j#�|
gzD]O}|j%|t'��D] }|���|j)|���"|j+��Q�jt-�tj.�y#t$rY��wxYwcc}w)Nr)rHrIrNrOrP�clear�updaterKrRrSrTrUrVrWrX�filterrrY�getr�register�_abc_caches_clearr	�_clear_type_cache)
rlrmrnrorprHrkrSrF�abs_classesrVrrs
             rrdrd�si�����H���Q����� � �"����!�!�"�%����!�!�#����"�"�3�'�3��	�&�&�,�,�.��&�&�-�-�c�2�9D���8O�8O�P�1�7�;�?�?�A�.�P�K�P���[�1�K��$���%�%�'�3�%�/�	$�C��x�x��S�U�+�
(���5�$��L�L���'�
(�
�!�!�#�		$�$��N������+�
��
��Qs�F� F*�	F'�&F'c���ttd��}td�D]
}|||dz�td�D�cgc]
}t|���c}ttdd��ycc}w)N�r���i)�bytesrZ�chrr^)�sr|s  rrMrM�s[��
�e�C�j��A�
�3�Z���	�!�A�a�C����3�Z� ��S��V� ���r�3����!s�A%)rKrN�inspectr�typingr�testr�test.supportr�runtestsr�utilsr	�_abcr
rUr�boolr�rdrMr<rr�<module>r�sg��
�����"�!��
J��a�"-�a��a�H!�H��g�J��J�J�s�A�A�A

Zerion Mini Shell 1.0