From: Balachandar <bala1486@gmail.com>
To: Namhyung Kim <namhyung@gmail.com>
Cc: kernelnewbies@nl.linux.org, linux-c-programming@vger.kernel.org
Subject: Re: Use of double pointer in linux kernel Hash list implementation
Date: Thu, 17 Jun 2010 10:34:46 -0400 [thread overview]
Message-ID: <AANLkTinj8yacrvasccTNM9CtF9pny0U3QX47wtRT-Abq@mail.gmail.com> (raw)
In-Reply-To: <1276745545.1712.8.camel@leonhard>
[-- Attachment #1: Type: text/plain, Size: 888 bytes --]
On Wed, Jun 16, 2010 at 11:32 PM, Namhyung Kim <namhyung@gmail.com> wrote:
> 2010-06-16 (수), 22:50 -0400, Balachandar:
> > Hi,
> > I am trying to understand Linux Kernel implementation of linked list
> > and hash table. A link to the implementation is here. I understood the
> > linked list implementation. But i am little confused of why double
> > pointers is being used in hlist (**pprev). Link for hlist is here. I
> > understand that hlist is used in implementation of hash table since
> > head of the list requires only one pointer and it saves space. Why
> > cant it be done using single pointer (just *prev like the linked
> > list)? Please help me.
> >
> >
> > Thanks,
> > Bala
>
>
> IMHO **pprev is only needed for fast deletion and/or insertion.
>
>
>
>
My doubt is why not use *prev as it is used in list_head implementation
rather than **pprev.
[-- Attachment #2: Type: text/html, Size: 1403 bytes --]
next prev parent reply other threads:[~2010-06-17 14:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-17 2:50 Use of double pointer in linux kernel Hash list implementation Balachandar
2010-06-17 3:32 ` Namhyung Kim
2010-06-17 14:34 ` Balachandar [this message]
2010-06-18 2:10 ` Namhyung Kim
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=AANLkTinj8yacrvasccTNM9CtF9pny0U3QX47wtRT-Abq@mail.gmail.com \
--to=bala1486@gmail.com \
--cc=kernelnewbies@nl.linux.org \
--cc=linux-c-programming@vger.kernel.org \
--cc=namhyung@gmail.com \
/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).