[Skiboot] [PATCH v9 04/11] skiboot/libc: Add hash primitives

Stewart Smith stewart at linux.vnet.ibm.com
Mon May 1 15:47:14 AEST 2017


Anju T Sudhakar <anju at linux.vnet.ibm.com> writes:
> From: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
>
> Patch implements a simple fixed-size hashtable and defines the
> hashtable APIs in include/hash.h. Hash function implemented here
> is fairly straightforward with a module operator. It implements
> a chaining hash, where hash collisions are simply added to entry list.
>
> Signed-off-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
> ---
>  include/hash.h           |  42 +++++++++++++++++
>  libc/Makefile.inc        |   2 +-
>  libc/hash.c              | 115 +++++++++++++++++++++++++++++++++++++++++++++++
>  libc/test/Makefile.check |   2 +-
>  libc/test/run-hash.c     |  36 +++++++++++++++
>  5 files changed, 195 insertions(+), 2 deletions(-)
>  create mode 100644 include/hash.h
>  create mode 100644 libc/hash.c
>  create mode 100644 libc/test/run-hash.c

Why are you creating a new hash table implementation rather than using
one from CCAN ? I think the one there is currently LGPL licensed, but
getting that changed to something that doesn't require us to talk to a
lawyer is probably rather easy.

Plus, the CCAN one has a much more extensive test suite, which is vastly
preferable than the minimal one here.

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list