lkml.org 
[lkml]   [2012]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 1/4] hashtable: introduce a small and naive hashtable
On Wed, Aug 01, 2012 at 09:06:50PM +0200, Sasha Levin wrote:
> Using a struct makes the dynamic case much easier, but it complicates the static case.
>
> Previously we could create the buckets statically.
>
> Consider this struct:
>
> struct hash_table {
> u32 bits;
> struct hlist_head buckets[];
> };
>
> We can't make any code that wraps this to make it work properly
> statically allocated nice enough to be acceptable.

I don't know. Maybe you can create an anonymous outer struct / union
and play symbol trick to alias hash_table to its member. If it is
gimped either way, I'm not sure whether it's really worthwhile to
create the abstraction. It's not like we're saving a lot of
complexity.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2012-08-01 23:22    [W:0.314 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site