On Mon, Apr 27, 2009 at 10:15 AM, Albin Tonnerre <albin.tonne...@gmail.com> wrote: > On Mon, Apr 27, 2009 at 09:18:39AM -0300, Gustavo Sverzut Barbieri wrote : >> Sachiel is right, List2 is the same as Inlist, lists where the data is >> the node, you avoid a bit of memory fragmentation. > > Eina_List can use the eina mempool, why Inlist can't, so I wouldn't say using > Inlists reduce memory fragmentation.
it does, since you'll always need the node itself, so you will always have that alloc. >> and also another >> pointer redirection (->data). > > That's the argument for using inlists in the kernel. I'm not sure how this > applies to ecore. same. We're not as performance freaks, but easy savings where possible are always good ;-) >> They're better suited for elements that >> are always in a list (ie: Evas_Object always in evas), but you can >> still have them in other Eina_List (not inlist!) if you wish. > >> The downside, at least at the moment, is that you don't have fast >> "count" operation, it need to walk the whole list in order to figure >> out how many elements exists. > >> But you can append fast (O(1)) since it >> will keep a pointer to last element. > > Eina_List too. sure, I was actually saying that append is O(1) even if count is O(n). Usually they're the same, but not in inlist. > Anyway, TBH I only did it this way because cedric advised me to do so. I'll > change it to Eina_Inlists if you think that really would have a benefit, > which I > doubt. if they were using the "inlist" paradigm, then it's actually easier to use inlist... maybe you'll have to use some macros like EINA_INLIST_GET(), but that's C fault :-) -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: barbi...@gmail.com Skype: gsbarbieri Mobile: +55 (19) 9225-2202 ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel