Sorry, you're right, delblock(b, 0) is called. delblock(b, 9) isn't
called. It's called for the sequence 8..0, as you stated.

So is this correct? Doesn't this mean one block will never get
released back to the temporary disc?

On Fri, Aug 12, 2016 at 6:48 PM, James A. Robinson
<jim.robin...@gmail.com> wrote:
> On Fri, Aug 12, 2016 at 8:32 AM Costin Chirvasuta <cost...@gmail.com> wrote:
>>
>> > So isn't the memmove just to cover the case where you are
>> > deleting a block that isn't at the very end?
>>
>> Yes, but from what I understand i is always lower.
>>
>> Say b->nbl starts at 10. i=b->nbl-1 so i=9. --i so i=8.
>> Inside delblock b->nbl-- so b->nbl is 9. i<nbl is true so the memmove
>> happens.
>>
>> Also delblock(b, 0) never seems to happen.
>
>
> My apologies, I wasn't paying enough attention.  Yes, I think you're correct
> that if b->nbl is 10 it would start off with deblock(b, 8).
>
> Why wouldn't delblock(b, 0) be called?  Wouldn't the sequence end up being
> 8,7,6,5,4,3,2,1,0, since only when it hits i=-1 would it evaluate to false?
>
> Jim
>

Reply via email to