
    sh
                     \    S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	  \S 5       r
\S 5       rg)	z6
Helpers to see the refcount information of an object
    )ir)typescgutils)	intrinsic)_meminfo_struct_typec                 :    S n[         R                  " U5      nX24$ )zwDump the refcount of an object to stdout.

Returns True if and only if object is reference-counted and NRT is enabled.
c                 N   Uu  nUR                   u  n/ nU R                  (       a-  U R                  R                  XU5      nUR	                  U5        U(       Ga<  U R                  U5      nUR                  5       n	UR                  SR                  U5      5        U H  u  pZUR                  U
[        R                  " 5       5      n[        R                  " XSS5      nUR                  U5      nUR                  SR                  U5      5        UR                  U[         R"                  " S5      5      n[        R$                  " USSX5      nUR'                  U5        M     UR                  S5        UR)                  U	5        [        R*                  $ [        R,                  $ )Nzdump refct of {}r   z | {} refct=       z%d [%p]z;
)args
enable_nrtnrtget_meminfosextendget_python_api
gil_ensureprint_stringformatbitcastr   
as_pointerr   gep_inboundsloadtruncr   IntTypesnprintf_stackbuffersys_write_stdoutgil_releasetrue_bit	false_bit)contextbuilder	signaturer   objtymeminfostmp_mispyapi	gil_statemimiptrrefctptrrefctrefct_32bitprinteds                   n/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/numba/core/unsafe/refcount.pycodegendump_refcount.<locals>.codegen   sY   ~~kk..wC@GOOG$**73E((*I188<=",@,K,K,MN"//1EX."">#8#8#<= &mmE2::b>B!66RK &&w/ # u%i(###$$$    )r   bool_	typingctxr#   r0   sigs       r/   dump_refcountr7      s     %B ++c
C<r2   c                 :    S n[         R                  " U5      nX24$ )zMGet the current refcount of an object.

FIXME: only handles the first object
c                    Uu  nUR                   u  n/ nU R                  (       a-  U R                  R                  XU5      nUR	                  U5        / nU(       a  U H  u  pYUR                  U	[        R                  " 5       5      n
[        R                  " XSS5      nUR                  U5      nUR                  U[        R                  " S5      5      nUR                  U5        M     US   $ )Nr   r
   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   append)r    r!   r"   r   r#   r$   r%   r&   	refcountsr)   r*   r+   r,   r-   s                 r/   r0   get_refcount.<locals>.codegen=   s    ~~kk..wC@GOOG$	",@,K,K,MN"//1EX.%mmE2::b>B  - # |r2   )r   int32r4   s       r/   get_refcountr>   7   s    $ ++c
C<r2   N)__doc__llvmliter   
numba.corer   r   numba.core.extendingr   numba.core.runtime.nrtdynmodr   r7   r>    r2   r/   <module>rE      sA     % * = ' 'T  r2   