ó r”ţfc@s ddlZddlZddlZddlZddlZddlZddlZddlZddlm Z m Z ddl m Z dgZ ejdkrÇddlmZdefd„ƒYZndefd „ƒYZd efd „ƒYZdefd „ƒYZdS( i˙˙˙˙N(tFinalizetinfo(tassert_spawningt BufferWrappertwin32(RtArenacBs/eZejƒZd„Zd„Zd„ZRS(cCse||_dtjƒtjjƒf|_tjd|jd|jƒ|_|j|jf|_ dS(Ns pym-%d-%di˙˙˙˙ttagname( tsizetostgetpidRt_countertnexttnametmmaptbuffert_state(tselfR((s,/usr/lib64/python2.7/multiprocessing/heap.pyt__init__=s "!cCst|ƒ|jS(N(RR(R((s,/usr/lib64/python2.7/multiprocessing/heap.pyt __getstate__Ds cCs>|\|_|_|_tjd|jd|jƒ|_dS(Ni˙˙˙˙R(RR RR R(Rtstate((s,/usr/lib64/python2.7/multiprocessing/heap.pyt __setstate__Hs!(t__name__t __module__t itertoolstcountR RRR(((s,/usr/lib64/python2.7/multiprocessing/heap.pyR9s   cBseZd„ZRS(cCs+tjd|ƒ|_||_d|_dS(Ni˙˙˙˙(R RRtNoneR (RR((s,/usr/lib64/python2.7/multiprocessing/heap.pyRQs (RRR(((s,/usr/lib64/python2.7/multiprocessing/heap.pyROstHeapcBsbeZdZejd„Zed„ƒZd„Zd„Z d„Z d„Z d„Z d„Z RS( icCsmtjƒ|_tjƒ|_||_g|_i|_i|_ i|_ t ƒ|_ g|_ g|_dS(N(RR t_lastpidt threadingtLockt_lockt_sizet_lengthst _len_to_seqt_start_to_blockt_stop_to_blocktsett_allocated_blockst_arenast_pending_free_blocks(RR((s,/usr/lib64/python2.7/multiprocessing/heap.pyR^s       cCs|d}|||@S(Ni((tnt alignmenttmask((s,/usr/lib64/python2.7/multiprocessing/heap.pyt_roundupks c Cstj|j|ƒ}|t|jƒkr|jt|j|ƒtjƒ}|jd9_t d|ƒt |ƒ}|j j |ƒ|d|fS|j|}|j |}|jƒ}|sÓ|j |=|j|=n|\}}}|j||f=|j||f=|S(Nis"allocating a new mmap of length %di(tbisectt bisect_leftR tlenR+tmaxRR tPAGESIZERRR&tappendR!tpopR"R#( RRtitlengthtarenatseqtblocktstarttstop((s,/usr/lib64/python2.7/multiprocessing/heap.pyt_mallocqs"!      c Cs!|\}}}y|j||f}Wntk r9nX|j|ƒ\}}y|j||f}Wntk rynX|j|ƒ\}}|||f}||}y|j|j|ƒWn4tk rö|g|j|#s          “