#ô > BLib.MAllocA 1.05 15Sep2011 6ô Version A: checks last slot before scanning list ô (]ô v1.05 15Sep2011 JGH Extends last slot into free space, adds names to heap on first call 28ô v1.04 12Aug2006 JGH Checks for size of free memory <*ô v1.03 23Jul2006 JGH m_zalloc() added F+ô v1.02 15Sep1989 JGH m_realloc() added P?ô v1.01 08Sep1989 JGH Bug in reuse of released memory fixed Z8ô v1.00 06Sep1989 JGH m_alloc() and m_free() written d: n ô Memory Allocation Routines x ô ~~~~~~~~~~~~~~~~~~~~~~~~~~ ‚<ô *BUG* When scanning heap, when link=0, !0 is read from Œ: –Dݤm_alloc(size%):êA%,B%,E%:m_heap%=m_heap%:çm_heap%=0:òm_free(0)  0size%=(size%+3)€-4:ÞE%-1:çsize%=0:=“-E%-1280 ªUA%=m_heap%:çA%:ç!A%<=size%:çA%+!A%+4=E%:ÞE%size%-!A%:!A%=size%:m_heap%=A%!4:=A%+4 ´2çA%:ç!A%=size%„A%=0 ¾çA%=0:ç“-E%-size%-1280<0:=0 È$çA%=0:ÞA%size%+3:!A%=size%:=A%+4 ÒUç!A%>size%+7:A%!(size%+8)=A%!4:A%!(size%+4)=!A%-size%-4:A%!4=A%+size%+4:!A%=size% Ü çB%:B%!4=A%!4 ‹ m_heap%=A%!4 æ =A%+4 ð: ú,Ýòm_free(ptr%):m_heap%=m_heap%:çptr%=0:á  !ptr%=m_heap%:m_heap%=ptr%-4 Aç!ptr%=ptr%+ptr%!-4:ptr%!-4=ptr%!-4+!!ptr%+4:!ptr%=!(!ptr%+4) á ": ,:ݤm_realloc(ptr%,size%):òm_free(ptr%):=¤m_alloc(size%) 6: @>ݤm_zalloc(size%):êA%:A%=¤m_alloc(size%):çA%=0„size%<1:=A% J*õsize%=size%-1:A%?size%=0:ýsize%<0:=A% ÿ