-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Julien Danjou wrote:
> At 1239871750 time_t, Uli Schlachter wrote:
>> How bad would it be to add color objects to lua? They do 
>> xcolor_init_unchecked()
>> when they are created and the xcolor_init_reply() can be delayed until they 
>> are
>> actually used (or garbage collected). That way colors could be reused and we
>> wouldn't have to xcolor_init_unchecked() the same color over and over again.
>>
>> On the other hand, this might be a little ugly on the lua API side....
> 
> As you point, it would be a little bit overkill on the Lua API side.
> What we could do is store colors in a cache, i.e. use an ordered array
> (like keybinding_t) of colors and add them when we get new colors.
> Since users usually use a bunch of a dozen of colors, it should not be
> too memory consuming.
> 
> On the other side, if the user uses all 2^24 colors it can grow
> up to 200 MB. ;-)
> 
> Cheers,

Then... Simply limit the number of colors in the cache and kick out the oldest
one if there is too few space available. The results wouldnt be much worse than
what we have currently if a user uses many colors, but it would be much better
if there are only a few used colors.

psychon

- --
"Do you know that books smell like nutmeg or some spice from a foreign land?"
                                                  -- Faber in Fahrenheit 451
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknnBnEACgkQABixOSrV999tqACfUWwmJj6WDK8qhn68Rv4mjLd5
Hz0AoIoMSwa/lQVSuYHjn22wd/9iEZF/
=FVfx
-----END PGP SIGNATURE-----

-- 
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.

Reply via email to