Re: Use of double pointer in linux kernel Hash list implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wed, Jun 16, 2010 at 11:32 PM, Namhyung Kim <namhyung@xxxxxxxxx> 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.  

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux