emacs-devel
[Top][All Lists]
Advanced

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

Re: [patch] cache color info for remote X sessions [Was: Emacs 21/X11 ge


From: Jan D.
Subject: Re: [patch] cache color info for remote X sessions [Was: Emacs 21/X11 generating unbelieveable network traffic]
Date: Mon, 7 Oct 2002 19:59:08 +0200

måndagen den 7 oktober 2002 kl 18.49 skrev Ami Fischman:

"Stefan Monnier" <monnier+gnu/address@hidden> writes:

[...]

As someone whose colormap is full about 95% of the time, I can
assure you that tose things happen ;-)

Really?  I guess I've been spoiled by my video card (which is a not very
respectable 4M matrox) and more respectable lack of use of colors :)

You can listen for XColormapEvent and invalidate the cache if the colormap
changes.  I think Emacs just uses one colormap.

The shame of not caching the XFreeColors has caught up with me, so I added
a refcount and a wrapper for XFreeColors that takes advantage of the
refcount (so the X server only sees the Free request once per cached color,
and upon final Free'ing, the cache entry is removed).  This ensures there
are no stale entries in the cache. The performance hit is negligible in my
tests.

The newest versions of xcache.[ch] reflect:
- Reformatted function calls to K&R style
- Added a lot of comments to explain what's going on
- Added refcounting & XFreeColors caching

Note that in order to take advantage of the XFreeColors caching, you need
to add the xcache.h header to other files.  Included is also a patch that
does that.


Or, for gcc, do
make CC='gcc -include xcache.h'

        Jan D.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]