> AllocTest3 + Claim and release random sized blocks : ( test%=3 2: < test%=1:ț "MallocA/sr" F test%=2:ț "MallocB/sr" P test%=3:ț "MallocC/sr" Z- test%=0: >&FFFF:ț @lib$+"MAlloc.bbc" d4 test%=0: <&FFFF:ț "%.^.Library.BLib.MAlloc" n >&FFFF:=+&4000 x( 26,12,20:x%=0:claimed%=2:size%=256 : !small1%=0:small2%=0:small3%=0 -size1%=0:size2%=0:size3%=(size%)+size%/2  heapbot% -1  a size1%=(size%):small1%=m_zalloc(size1%):small1%:!small1%=size1%:claimed%=claimed%+size1% a size2%=(size%):small2%=m_zalloc(size2%):small2%:!small2%=size2%:claimed%=claimed%+size2% a size3%=(size%):small3%=m_zalloc(size3%):small3%:!small3%=size3%:claimed%=claimed%+size3%  heapend% -1:30  "Claimed: ";claimed%; $ " Used: ";heapend%-heapbot%; 1 " Leaked: ";(heapend%-heapbot%)-claimed%; E " Overhead: ";(100*((heapend%-heapbot%)/claimed%)-100);"% "; r '"small1%=";~small1%;"+";~size1%;" small2%=";~small2%;"+";~size2%;" small3%=";~small3%;"+";~size3%;" " T 0,1: 69,x%,claimed%/32 :x%=&300: 5,11:"claimed";4; Q 0,3: 69,x%,(heapend%-heapbot%)/32 :x%=&320: 5,11:"used";4; "P 0,5: 69,x%,((heapend%-heapbot%)-claimed%)/32:x%=&340: 5:"leaked";4; ,U 0,7: 69,x%,((heapend%-heapbot%)/claimed%)*8 :x%=&360: 5,11:"overhead";4; 6 : @@ small3%:A%=!small3%:m_free(small3%):claimed%=claimed%-A% J@ small2%:A%=!small2%:m_free(small2%):claimed%=claimed%-A% T@ small1%:A%=!small1%:m_free(small1%):claimed%=claimed%-A% ^1 OSCLI"Memory "+STR$~(heapbot%+220)+"+100" h x%=x%+2 r heap: IFGET | x%>&800:'  : $heap:6"Addr"6"Size"6"Link" A%=m_heap%: #~A%;: A%:~!A%,~A%!4;:A%=A%!4 : A%=0 >20:30: :