linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@gmail.com>
To: Balachandar <bala1486@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 12:32:25 +0900	[thread overview]
Message-ID: <1276745545.1712.8.camel@leonhard> (raw)
In-Reply-To: <AANLkTilGln3yZRl1muugML4Qg_1rcTXTf3UeAIzLTOJT@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

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.


-- 
Regards,
Namhyung Kim


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2010-06-17  3:32 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 [this message]
2010-06-17 14:34   ` Balachandar
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=1276745545.1712.8.camel@leonhard \
    --to=namhyung@gmail.com \
    --cc=bala1486@gmail.com \
    --cc=kernelnewbies@nl.linux.org \
    --cc=linux-c-programming@vger.kernel.org \
    /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).