Re: [PATCH 1/3] implement generic key/value map

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

 



On Thu, Jul 14, 2011 at 09:07:54PM +0200, Bert Wesarg wrote:

> > Yeah, you could treat this like a C++ template and assume random bits of
> > code will instantiate a map of whatever types they need. But this is C,
> > and we only want to instantiate once. So I just figured to keep the
> > static list of whatever maps git needs in the map.[ch] files.
> 
> When I wrote such macros in the past, the 'generated' functions where
> all static. So one could instantiate a map multiple times in different
> compilation units where one need to access this type of map.

Yeah, that would work. It can bloat the code more, but in practice, not
much. It would also work better if we were providing the map API as a
library to arbitrary code. But we have the luxury of knowing all of the
types that will be used with it at compile time. :)

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]