This should really remove unused items that would age forever in the
last, forcing old but not so to be evicted before them.
Fortunately it was not so complex to add, and should wait just 3
pointers more of space per node.
SVN revision: 39350
This cache is very simple and should work fine when system does not
change, it keeps a direct association of mime-types and found icons,
remembering theme and icon size. Search is very fast since it uses
stringshared strings and thus direct pointer comparison in hash
search. We could optimize it even more if we assumed stringshared
strings to come in, so no need to eina_stringshare_add() (which is a
hash per se), using just eina_stringshare_ref().
Cache population is limited to compile-time value and just values
older than a given threshold are deleted. I do not keep a LRU explicit
list, so you might have some old but unused items always alive. I
don't find this too bad, sure it will consume more memory, but will
not hurt performance. We can change this to purge all expired items by
not checking for number of items to remove, removing all that match.
Next I plan to find out a good way to cache and speed up file->mime
discovery. I plan to do auto-generated state-machine to match
extensions, so you don't need to check the same extension character
more than once. Example:
Input: bla.edc
Extensions: edc edj eps png bmp
It would first try to match against 'e', 'p' and 'b'. It will match
'e' and then check for 'd' (edc or edj) or 'p' (eps). It will match
'd' and then check for 'c' or 'j'. This will reduce number of
comparisons considerably.
As I'm running out of time (4am, not much time left on this month), I
could use some help here.
SVN revision: 39343
EINA_ITERATOR_FOREACH() and EINA_ACCESSOR_FOREACH() are new macros to
help us forget about nasty C details (like cast to (void **)).
Document most iterators and accessors.
All iterators now set EINA_ERROR_OUT_OF_MEMORY if it's the case.
SVN revision: 39267
Left warnings regarding signed and unsigned comparison since
eina_list_count() returns unsigned, can use a cast in this return, but
not big deal for now.
By: Luis Felipe Strano Moraes & myself.
SVN revision: 39260
* efreet_desktop_command_build(): should consider the first
run. Before had a "first" toggle variable, which vanished with eina
port. I changed it to do {} while (), making it work again.
* exec string is already freed by callback (in e_exec.c), to keep old
behavior, just free the list with eina_list_free(). Just pay
attention to ecore_list and double check if they had a free
function set or not. If it didn't, then we should not free nodes!
SVN revision: 39228