pixmap caching




Is it correct, that pixmap_cache_set when removing from cache starts from
"oldest", and any usage pushes the node to the oldest ones, via
prepend_to_age_list (n);
       
If the cache fills up, no new nodes can "enter" (b/c they are immediately
removed, since they are marked as "oldest").

My quick solution is to use append_to_age_list instead (although i'd invert the names)
which puts a node to the "newest" extreme.


static void
append_to_age_list (pixmap_cache_node *n)
{
    n->older = newest;
    if (n->older != 0)
	n->older->newer = n;
    newest = n;

    n->newer = 0;
    if (oldest == 0)
	oldest = n;
}


Or, maybe i have missed something.




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