+
     Bij-                        ^ RI t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^RIH	t	H
t
 ^RIHt R.t]P                  R8X  d   ^ RIt ! R R]4      tM$ ! R	 R]4      tR
 tR t]	P(                  ! ]]4        ! R R]4      t ! R R]4      tR# )    N)defaultdict)	reductionassert_spawning)utilBufferWrapperwin32c                   T   a  ] tR t^t o ]P
                  ! 4       tR tR tR t	Rt
V tR# )Arenac                   Wn         \        ^d4       Fx  pR\        P                  ! 4       \	        V P
                  4      3,          p\        P                  ! RWR7      p\        P                  ! 4       ^ 8X  d    MVP                  4        Kz  	  \        R4      hW0n        W@n        V P                   V P                  3V n        R# )d   z	pym-%d-%stagnamezCannot find name for new mmapN)sizerangeosgetpidnext_randmmap_winapiGetLastErrorcloseFileExistsErrornamebuffer_state)selfr   ir   bufs   &&   +/usr/lib/python3.14/multiprocessing/heap.py__init__Arena.__init__&   s    I3Z"biik4

3C%DDiiD7'')Q.		   &&EFFIK99dii0DK    c                0    \        V 4       V P                  # N)r   r   )r   s   &r!   __getstate__Arena.__getstate__5   s    D!;;r$   c                    V;w  V n         V n        V n        \        P                  ! RV P                   V P                  R7      V n        R# )   r   Nr   )r   r   r   r   r   )r   states   &&r!   __setstate__Arena.__setstate__9   s3    166 DIty4;))B		499EDKr$   )r   r   r   r   N)__name__
__module____qualname____firstlineno__tempfile_RandomNameSequencer   r"   r'   r,   __static_attributes____classdictcell____classdict__s   @r!   r
   r
      s+     
 ,,.	1		F 	Fr$   r
   c                   ^   a  ] tR t^Ct o ]P
                  R8X  d   R.tM. tRR ltR tRt	V t
R# )r
   linuxz/dev/shmc                   Wn         W n        VR8X  d   \        P                  ! R\        P
                  ! 4       ,          V P                  V4      R7      w  V n        p\        P                  ! V4       \        P                  ! V \        P                  V P                  34       \        P                  ! V P                  V4       \        P                  ! V P                  V P                   4      V n        R# )r*   zpym-%d-)prefixdirNr   )r   fdr2   mkstempr   r   _choose_dirunlinkr   Finalizer   	ftruncater   r   )r   r   r=   r   s   &&& r!   r"   r#   M   s    IGRx !) 0 0%biik1))$/!1 		$dBHHtwwj9TWWd+))DGGTYY7DKr$   c                    V P                    F?  p\        P                  ! V4      pVP                  VP                  ,          V8  g   K=  Vu # 	  \
        P                  ! 4       # r&   )_dir_candidatesr   statvfsf_bavailf_frsizer   get_temp_dir)r   r   dsts   &&  r!   r?   Arena._choose_dir[   sL     ))ZZ];;,4H * $$&&r$   )r   r=   r   N)r   )r.   r/   r0   r1   sysplatformrD   r"   r?   r4   r5   r6   s   @r!   r
   r
   C   s.     
 <<7")lO O	8	' 	'r$   c                     V P                   R8X  d   \        R4      h\        V P                  \        P
                  ! V P                   4      33# )r*   zDArena is unpicklable because forking was enabled when it was createdr   )r=   
ValueErrorrebuild_arenar   r   DupFd)as   &r!   reduce_arenarS   d   sC    442: G H Hqvvyqtt'<===r$   c                 4    \        WP                  4       4      # r&   )r
   detach)r   dupfds   &&r!   rP   rP   j   s    T<<>**r$   c                      a  ] tR t^st o ^tRtRt]P                  3R lt	]
R 4       tR tR tR tR tR tR tR	 tR
 tR tRtV tR# )Heapc                   \         P                  ! 4       V n        \        P                  ! 4       V n        Wn        . V n        / V n        / V n	        / V n
        \        \        4      V n        . V n        . V n        ^ V n        ^ V n        R# )r   N)r   r   _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)r   r   s   &&r!   r"   Heap.__init__{   sw    		^^%

   " ! "-S!1 %'! r$   c                4    V^,
          pW,           V( ,          # )r*    )n	alignmentmasks   && r!   _roundupHeap._roundup   s     1}TE!!r$   c                V   V P                  \        V P                  V4      \        P                  4      pV P                  V P
                  8  d   V ;P                  ^,          un        \        P                  ! RV4       \        V4      pV P                  P                  V4       V^ V3# )   z"allocating a new mmap of length %d)ro   maxr^   r   PAGESIZE_DOUBLE_ARENA_SIZE_UNTILr   infor
   re   append)r   r   lengtharenas   &&  r!   
_new_arenaHeap._new_arena   sy    s4::t4dmmD ::555JJ!OJ		6?fE"q&!!r$   c                   VP                   pW P                  8  d   R # V P                  P                  V4      pV P                  V^ 3 V P
                  W3 V P                  P                  V4       V P                  V,          pVP                  V^ V34       V'       g+   V P                  V V P                  P                  V4       R # R # r&   )
r   _DISCARD_FREE_SPACE_LARGER_THANrd   popra   rb   re   remover`   r_   )r   ry   rx   blocksseqs   &&   r!   _discard_arenaHeap._discard_arena   s     888''++E2  %,0E"v&

E1f%&  (MM  ( r$   c                   \         P                  ! V P                  V4      pV\        V P                  4      8X  d   V P	                  V4      # V P                  V,          pV P
                  V,          pVP                  4       pV'       g   V P
                  V V P                  V Vw  rgpV P                  Wg3 V P                  Wh3 V# r&   )	bisectbisect_leftr_   lenrz   r`   r~   ra   rb   )	r   r   r   rx   r   blockry   startstops	   &&       r!   _mallocHeap._malloc   s    t}}d3DMM""??4((]]1%F""6*CGGIE$$V,dmmA.>$t  %0.r$   c                   Vw  r#p V P                   W#3,          pV P                  V4      w  r6 V P                  W$3,          pV P                  V4      w  rdW#V3pWC,
          p V P                  V,          P                  V4       WP                  W#3&   WP                   W$3&   R #   \         d     Li ; i  \         d     Lmi ; i  \         d5    T.T P                  T&   \        P                  ! T P                  T4        Li ; ir&   )	rb   _absorbKeyErrorra   r`   rw   r   insortr_   )	r   r   ry   r   r   
prev_block_
next_blockrx   s	   &&       r!   _add_free_blockHeap._add_free_block   s
   $t	0,,e^<J ||J/HE	/--um<J ll:.GAt$	1V$++E2
 05e^,-2UM*-  		  		  	1(-wDV$MM$--0	1s4   B% B6 #"C %B32B36CC<DDc                   Vw  r#pV P                   W#3 V P                  W$3 WC,
          pV P                  V,          pVP                  V4       V'       g)   V P                  V V P                  P                  V4       W43# r&   )ra   rb   r`   r   r_   )r   r   ry   r   r   rx   r   s   &&     r!   r   Heap._absorb   sz    $t  %0.v&

5  (MM  ({r$   c                    Vw  r#pV P                   V,          pVP                  W434       V'       g   V P                  V4       R # R # r&   )rd   r   r   )r   r   ry   r   r   r   s   &&    r!   _remove_allocated_blockHeap._remove_allocated_block   s@    "d''.um$& r$   c                      V P                   P                  4       pT P                  T4       T P	                  T4       K@    \         d     R# i ; i)TN)rf   r~   
IndexErrorr   r   r   r   s   & r!   _free_pending_blocksHeap._free_pending_blocks  sP    11557   '((/  s   A AAc                D   \         P                  ! 4       V P                  8w  d9   \        R P	                  \         P                  ! 4       V P                  4      4      hV P
                  P                  R4      '       g   V P                  P                  V4       R#  V ;P                  ^,          un	        V P                  4        V P                  V4       V P                  V4       V P
                  P                  4        R#   T P
                  P                  4        i ; i)z$My pid ({0:n}) is not last pid {1:n}FN)r   r   rZ   rO   formatr]   acquirerf   rw   rh   r   r   r   releaser   s   &&r!   free	Heap.free  s     99;$--'6==IIK/0 0 zz!!%(( %%,,U3%"))+$$U+,,U3

""$

""$s   AD Dc                   V^ 8  d   \        RP                  V4      4      h\        P                  V8:  d   \	        RP                  V4      4      h\
        P                  ! 4       V P                  8w  d   V P                  4        V P                  ;_uu_ 4        V ;P                  ^,          un
        V P                  4        V P                  \        V^4      V P                  4      pV P                  V4      w  r#pW1,           pWT8  d   V P!                  W%V34       V P"                  V,          P%                  W534       W#V3uuRRR4       #   + '       g   i     R# ; i)r   Size {0:n} out of rangeSize {0:n} too largeN)rO   r   rL   maxsizeOverflowErrorr   r   rZ   r"   r]   rg   r   ro   rs   
_alignmentr   r   rd   add)r   r   ry   r   r   	real_stops   &&    r!   mallocHeap.malloc(  s    !86==dCDD;;$ 6 = =d CDD99;$--'MMOZZZOOq O%%'==T1t?D#'<<#5 U4I $$e%=>""5)--u.@A), ZZZs   B+EE 	)rd   re   rZ   r`   r_   r]   rh   rg   rf   r^   ra   rb   Ni  @ )r.   r/   r0   r1   r   r}   ru   r   rt   r"   staticmethodro   rz   r   r   r   r   r   r   r   r   r4   r5   r6   s   @r!   rX   rX   s   sj      J&3#, MM : " "

")$"3<'0%8- -r$   rX   c                   :   a  ] tR tRt o ]! 4       tR tR tRtV t	R# )r   iB  c                X   V^ 8  d   \        RP                  V4      4      h\        P                  V8:  d   \	        RP                  V4      4      h\
        P                  P                  V4      pW!3V n        \        P                  ! V \
        P                  P                  V3R7       R# )r   r   r   )argsN)rO   r   rL   r   r   r   _heapr   r   r   rA   r   )r   r   r   s   && r!   r"   BufferWrapper.__init__F  s    !86==dCDD;;$ 6 = =d CDD##**40mdM//44E8Dr$   c                `    V P                   w  w  rr4\        VP                  4      W"V,            # r&   )r   
memoryviewr   )r   ry   r   r   r   s   &    r!   create_memoryviewBufferWrapper.create_memoryviewO  s+    %)[["t%,,'Dj99r$   )r   N)
r.   r/   r0   r1   rX   r   r"   r   r4   r5   r6   s   @r!   r   r   B  s     FEE: :r$   )r   collectionsr   r   r   rL   r2   r[   contextr   r    r   __all__rM   r   objectr
   rS   rP   registerrX   r   rk   r$   r!   <module>r      s     #  	 
   / 
 <<7F FH' 'B>+ ul+I-6 I-^:F :r$   