policy BEST
green = correct |
red = wrong |
Operation | Returned | Free List | |||
---|---|---|---|---|---|
ptr[0]=Alloc(1) | 1000 | addr: 1001 size: 99 |
addr: size: |
addr: size: |
addr: size: |
Free(ptr[0]) | 0 | addr: 1000 size: 1 |
addr: 1001 size: 99 |
addr: size: |
addr: size: |
ptr[1]=Alloc(2) | 1001 | addr: 1000 size: 1 |
addr: 1003 size: 97 |
addr: size: |
addr: size: |
Free(ptr[1]) | 0 | addr: 1000 size: 1 |
addr: 1001 size: 2 |
addr: 1003 size: 97 |
addr: size: |
ptr[2]=Alloc(5) | 1003 | addr: 1000 size: 1 |
addr: 1001 size: 2 |
addr: 1008 size: 92 |
addr: size: |
Free(ptr[2]) | 0 | addr: 1000 size: 1 |
addr: 1001 size: 2 |
addr: 1003 size: 5 |
addr: 1008 size: 92 |
ptr[3]=Alloc(10) | 1008 | addr: 1000 size: 1 |
addr: 1001 size: 2 |
addr: 1003 size: 5 |
addr: 1018 size: 82 |
ptr[4]=Alloc(10) | 1018 | addr: 1000 size: 1 |
addr: 1001 size: 2 |
addr: 1003 size: 5 |
addr: 1028 size: 72 |
ptr[5]=Alloc(6) | 1028 | addr: 1000 size: 1 |
addr: 1001 size: 2 |
addr: 1003 size: 5 |
addr: 1034 size: 66 |
ptr[6]=Alloc(8) | 1034 | addr: 1000 size: 1 |
addr: 1001 size: 2 |
addr: 1003 size: 5 |
addr: 1042 size: 58 |