9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Costin Chirvasuta <costinc@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] bufreset deletes b->nbl-1 blocks?
Date: Fri, 12 Aug 2016 18:29:47 +0300	[thread overview]
Message-ID: <CAPv5z_0RUfRBszV07h0vzxA_YrUYV+_KMgwXfJEQTbdMJUBBrA@mail.gmail.com> (raw)
In-Reply-To: <CAPd04b7R0OekF3cfRomf9FDBC8BPAWKcvkXFdia4nc6MM5ZV=w@mail.gmail.com>

> 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.

On Fri, Aug 12, 2016 at 6:20 PM, James A. Robinson
<jim.robinson@gmail.com> wrote:
> But delblock only calls memmove if i is less then b->nbl, which was
> just decremented, correct?
>
> So isn't the memmove just to cover the case where you are
> deleting a block that isn't at the very end?
>
> Jim
>



  reply	other threads:[~2016-08-12 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12 12:30 Costin Chirvasuta
2016-08-12 15:20 ` James A. Robinson
2016-08-12 15:29   ` Costin Chirvasuta [this message]
2016-08-12 15:48     ` James A. Robinson
2016-08-12 16:10       ` Costin Chirvasuta
2016-08-12 16:16         ` James A. Robinson
2016-08-12 16:25           ` Costin Chirvasuta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPv5z_0RUfRBszV07h0vzxA_YrUYV+_KMgwXfJEQTbdMJUBBrA@mail.gmail.com \
    --to=costinc@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).